I have CentOS6 on which I have configured puppet server. but Whenever I try to execute ant puppet command it fails with ruby issue. see the output for puppet --version
-bash-4.1# puppet --version
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/json-1.8.3/lib/json/ext/parser.so: [BUG] Segmentation fault
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
Aborted (core dumped)
Tried re-installing puppet and ruby but no luck.
Try I had a similar issue, and did a few things and it was fixed before I knew which one fixed it, but try this:
gem update --system
yum install ruby-json
Good luck!
Your Ruby 1.8.7 is trying to use a 1.9.3 gem for some reason.
This can be tricky to get right. In your shoes, I would check if I can
get rid of ruby1.8 altogether
make ruby1.9 the default Ruby on the system
make sure that Puppet always uses ruby1.9
Specifics depend heavily on the way Ruby and Puppet were actually installed.
Related
I'm not a rubyist and there might be something obvious I'm missing.
I've wrote an application in Ruby 1.8.7, I'm trying to package it in Vagrant (running Raring 13.04), but I've to run "bundle install" to install the requirements and even though gem1.8 does exist, running bundle install still install the gems for Ruby 1.9.3. And then my program fails at runtime...
Any idea about how to solve this?
UPDATE 1
The related Gemfile (thanks to the first answerers):
ruby '1.8.7'
# ...
gem 'trollop'
but for ruby1.8 myfile.rb an error is raised
no such file to load -- trollop (LoadError)
After investigation, the problem looks in bundle install:
Your Ruby version is 1.9.3, but your Gemfile specified 1.8.7
I don't get how to solve the problem.
UPDATE 2
After following the advices from #klaffenboeck things have changed. I'm using RVM and have Ruby 1.8.7 when entering in the project folder. Bundler seems to install things correctly, however the require seems to fail... Path problem?
See here for detail about Vagrant / RVM setup: https://rvm.io/integration/vagrant
UPDATE 3
Problem solved, I was missing a:
require 'rubygems'
before all gems (it worked locally but not in Vagrant).
Bundler will install gems (by default) for whichever Ruby is in your PATH.
Try /usr/bin/env ruby -v or which ruby to figure out which one that is; my guess is you're running bundler with Ruby 1.8.
Adding
ruby '1.8.7'
on top of your Gemfile will help diagnose.
Not aware of this problem in general, but try to put the ruby-version at the top of your gemfile:
#Gemfile
ruby '1.8.7'
# followed by your gems
Edit:
this is most likely because your Gemfile.lock states ruby 1.9.3 - run bundle update
Try running gem uninstall bundler, then gem1.8 install bundler.
Your bundle command seems to be running under Ruby 1.9.3. You can verify which ruby executable bundler is using with head -n 1 $(which bundle). You want it to be ruby1.8.
I have the following problem and whatever I try, nothing helps. I hope someone could help me with this.
I have a redhat server and I'm trying to install redmine on it. Redmine needs Ruby >= 1.8.7 to run so I installed it and when I execute ruby -v in the console it says I have version 1.8.7 (so that's great)
[root#vms redmine]# ruby -v
ruby 1.8.7 (2008-05-31 patchlevel 0) [x86_64-linux]
But when i try to install the passenger gem I need to run redmine on Apache it says I don't have ruby 1.8.7
[root#vms redmine]# gem install passenger
ERROR: Error installing passenger:
rake requires Ruby version >= 1.8.6
Does anyone know how this can be fixed?
You need newer ruby, you have patchlevel 0, try to get patchlevel 173 at least.
RVM can help you.
Using vendor build ruby packages is an exercise in frustration.
For anything with ruby it's easier just to use RVM and build a virtual environment. You can then build exactly what you need and have an environment you can replicate reliably. Also you won't end up clobbering your vendor's Ruby install.
I am trying to run this project https://github.com/eLobato/cartodb-rb-client but apparently either my rvm is messed up or pg has a terrible bug.
This is the error trace
/usr/bin/ruby1.8 -S bundle exec rspec "./spec/model/data_spec.rb" "./spec/model/metadata_spec.rb" "./spec/model/scopes_spec.rb" "./spec/client_spec.rb"
/home/daniel/.rvm/gems/ruby-1.9.2-p290#cartodb-rb-client/gems/pg-0.11.0/lib/pg_ext.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Aborted
rake aborted!
ruby -S bundle exec rspec "./spec/model/data_spec.rb" "./spec/model/metadata_spec.rb" "./spec/model/scopes_spec.rb" "./spec/client_spec.rb" failed
Tasks: TOP => spec
(See full trace by running task with --trace)
The Segmentation fault line really bugs me a lot because I tried to reinstall pg with no avail. I am running Ubuntu 11.10 and I have installed both ruby 1.9.2 and 1.8.7
Any clue?
I had this error too. Fixed it by removing all versions of Ruby installed on my system, then re-installing 1.9.3
Like so:
$ rvm remove all
$ rvm install ruby-1.9.3-p392
You're running a system Ruby 1.8.7 interpreter, but somehow loading a pg gem installed under Ruby 1.9.2 installed via rvm.
Ruby 1.8.7 and 1.9.2 have substantially different ABIs, so their extensions are not interchangeable.
For me it seemed to be the version of the pg gem that was in my Gemfile.lock. I had 0.13.2 in there, and it just didn't seem to work on Ruby 1.9.3. I ran bundle update pg and got 0.14.0, and then things started working.
Segmentation fault is, when program is accessing memory, which kernel don't expect (out of index, out of memory allocated block etc.).
What do you see, when you try:
ruby -S bundle --trace exec rspec "./spec/model/data_spec.rb" "./spec/model/metadata_spec.rb" "./spec/model/scopes_spec.rb" "./spec/client_spec.rb"
as backtrace advice to you?
I'm new to ubuntu, and might have had a couple of
false starts updating ruby / rails. I'm trying
to start clean by removing all versions of every
thing ruby from my system
I think I've installed everything through either
Synaptic, or aptitude purge, but I can still do the
following:
jwally#jwally-laptop:~$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
jwally#jwally-laptop:~$ gem -v
1.3.7
jwally#jwally-laptop:~$ irb
irb(main):001:0> RUBY_VERSION
=> "1.9.2"
but when I type "dpkg -l | grep ruby,
I only get the following:
rc ruby1.8-elisp 1.8.7.249-2 ruby-mode for Emacsen
thanks in advance
You may have installed an instance of Ruby without using Ubuntu's package system. Try:
which ruby
If this yields something other than /usr/bin/ruby (such as /usr/local/bin/ruby), then this is the case. Ubuntu can't uninstall locally installed stuff. You need to do that manually.
To see which package ruby is owned by run:
dpkg -S `which ruby`
If it can't find the package, then Ruby was installed outside of the Ubuntu package manager. You'll have to remove it manually.
I'll once again recommend this blog post for instructions on the best way to install Ruby on Ubuntu: Ubuntu, Ruby, RVM, Rails, and You.
I decided to upgrade to 1.9.2 ruby yesterday and also installed rvm to do it. I ran a few recent files I had working previously on 1.8.7 but anything requiring nokogiri fails with the following errors.
/Users/myusername/.rvm/gems/ruby-1.9.2-p0/gems/nokogiri-1.4.3.1/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
I am running nokogiri 1.4.3.1, ruby 1.9.2 on OSX Snow Leopard 10.6.4
If you get a Segmentation fault error from nokogiri, e.g., when you open your rails console, and you are using RVM and your ruby version is 1.9.2 something (mine currently is 1.9.2p136) and you notice a reference to ruby 1.8.7 just after the nokogiri segmentation fault message, then perhaps the following may be of assistance...
ERROR
$ rails c
/Users/lex/.rvm/gems/ruby-1.9.2-p136#lmi/gems/nokogiri-1.4.4/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
Abort trap
SOLUTION
(1) make sure that ruby 1.8.7 is not a rvm ruby version:
- run rvm list
if it is, then remove it: ex: rvm uninstall ree-1.8.7-2010.02
(2) uninstall nokogiri and libxml2 related dependencies:
$ gem uninstall nokogiri
$ brew uninstall libxml2
(3) install libxml2 using homebrew
$ brew install libxml2
$ brew link libxml2
(4) install libxslt from source
$ wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
$ tar -zxvf libxslt-1.1.26.tar.gz
$ cd libxslt-1.1.26
$ ./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.7
$ make
$ sudo make install
(5) install nokogiri
gem install nokogiri
Alternative (ensure your paths are correct): gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.7/include --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.7/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
(6) test
$ rails c
Loading development environment (Rails 3.0.3)
>>
Getting and keeping your Ruby XML parsing libraries running properly can be an issue. Here are some alternatives: LibXML, Hpricot, REXML
I'm guessing you just need to tell rvm to use the correct ruby.
rvm 1.9.2
Otherwise why would your second line indicate 1.8.7?
You shouldn't expect native code compiled against one major version of ruby to link cleanly to another. There's no ABI contract, afaik.
https://rvm.io/rvm/basics/
https://rvm.io/rvm/cli/
Is it possible you originally built Nokogiri on Leopard then upgraded to Snow Leopard?
If so, do a gem uninstall nokogiri followed by gem install nokogiri. That will force it to recompile for your currently selected Ruby and OS.
I saw the similar problems when I upgraded from Leopard to Snow Leopard, and reinstalled my Ruby. The gems didn't get recompiled, so I had to force several of them to do so.
Try running rvm requirements in Terminal and see if there are any missing dependencies. (It shows in red in my OS X)
The returned notes helped me install missing dependencies with brew, with clearly stated steps.
all the suggestions here didn't work for me, but the abridged answer to this issue by mmrobins below:
rvm gemset empty
followed by a standard bundle install got everything working for me.