RVM error when installing gems

2019-06-25 01:20发布

问题:

I get this RVM error when I install rubygems.

/Users/yannick/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.3/lib/yard.rb:38: [BUG] Bus Error
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]

-- control frame ----------
c:0019 p:---- s:0074 b:0074 l:000073 d:000073 CFUNC  :callcc
c:0018 p:0080 s:0071 b:0071 l:000a40 d:000a40 TOP    /Users/yannick/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.3/lib/yard.rb:38
c:0017 p:---- s:0068 b:0068 l:000067 d:000067 FINISH
c:0016 p:---- s:0066 b:0066 l:000065 d:000065 CFUNC  :require
c:0015 p:0053 s:0062 b:0062 l:0024b8 d:0024b8 METHOD /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36
c:0014 p:0030 s:0055 b:0055 l:000998 d:000998 METHOD /Users/yannick/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.3/lib/yard/rubygems/doc_manager.rb:5
c:0013 p:0080 s:0052 b:0052 l:0003e8 d:0003e8 METHOD /Users/yannick/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.3/lib/yard/rubygems/doc_manager.rb:59
c:0012 p:0021 s:0049 b:0049 l:0000e8 d:0000e8 METHOD /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/doc_manager.rb:116
c:0011 p:0037 s:0046 b:0046 l:0025f0 d:001a60 BLOCK  /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:148
c:0010 p:---- s:0043 b:0043 l:000042 d:000042 FINISH
c:0009 p:---- s:0041 b:0041 l:000040 d:000040 CFUNC  :each
c:0008 p:0200 s:0038 b:0038 l:0025f0 d:0025f0 METHOD /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:147
c:0007 p:0076 s:0032 b:0032 l:0026a0 d:0026a0 METHOD /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278
c:0006 p:0193 s:0028 b:0028 l:000010 d:000010 METHOD /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:147
c:0005 p:0013 s:0022 b:0022 l:000088 d:000088 METHOD /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:117
c:0004 p:0178 s:0017 b:0017 l:000110 d:000110 METHOD /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:65
c:0003 p:0164 s:0009 b:0009 l:000aa8 d:001960 EVAL   /Users/yannick/.rvm/rubies/ruby-1.9.2-p290/bin/gem:21
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000aa8 d:000aa8 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/bin/gem:21:in `<main>'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:65:in `run'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:117:in `run'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:147:in `process_args'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278:in `invoke'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:147:in `execute'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:147:in `each'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:148:in `block in execute'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/doc_manager.rb:116:in `generate_ri'
/Users/yannick/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.3/lib/yard/rubygems/doc_manager.rb:59:in `install_ri_yard'
/Users/yannick/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.3/lib/yard/rubygems/doc_manager.rb:5:in `load_yardoc'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/yannick/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/yannick/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.3/lib/yard.rb:38:in `<top (required)>'
/Users/yannick/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.3/lib/yard.rb:38:in `callcc'

-- C level backtrace information -------------------------------------------
0   libruby.1.9.1.dylib                 0x0000000109e384fe rb_vm_bugreport + 110
1   libruby.1.9.1.dylib                 0x0000000109d2c513 report_bug + 259
2   libruby.1.9.1.dylib                 0x0000000109d2c681 rb_bug + 161
3   libruby.1.9.1.dylib                 0x0000000109dcef92 sigbus + 18
4   libsystem_c.dylib                   0x00007fff89bbbcfa _sigtramp + 26
5   ???                                 0x00007fff6992ec40 0x0 + 140734964624448

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

The gems are installed fine but i'm not sure if everything is in order. Has somebody had the same issue?

回答1:

According to http://redmine.ruby-lang.org/issues/4651 it's an issue in Ruby and is fixed in 1.9.3.

Alternately, you can rebuild ruby 1.9.2 using gcc, not Apple's llvm-gcc, which is the default gcc on XCode 4.x.

If you have made the unfortunate mistake (like me) of upgrading to XCode 4.2 before building Ruby, you'll need to either downgrade to XCode 4.1 or install GCC

This gist has a link to XCode 4.1 installer if you're an Apple dev. Otherwise you can install GCC using this installer and set your CC env variable to /Developer/usr/bin/i686-apple-darwin11-gcc-4.2.1 (you will probably also want to set $CXX to i686-apple-darwin11-g++-4.2.1 if you use Gems with C++ externals).



回答2:

If you get osx, just install gcc from https://github.com/kennethreitz/osx-gcc-installer.git i suggest you use rbenv which don't hack your cd... I left from rvm to rbenv and i feel better :D

here are the steps: just install it from: https://github.com/sstephenson/rbenv then install your ruby version: rbenv install 1.9.2-p290 choose your global version: rbenv global 1.9.2-p290

and if you need a specific version in a project: cd ~/myproject; rbenv install 1.9.3-p0; rbenv local 1.9.3-p0;

that's it!



标签: rubygems rvm