install bundler using rvm, ruby 1.8.7 with gcc 4.7 on linux

不问归期 提交于 2020-01-01 09:59:22

问题


Issues building ruby 1.8.7 or installing the bundler gem with GCC 4.7 on linux (Fedora 17, Arch, etc.). This issue occurred for me using RVM. I was able to install 1.8.7, but unable to install the bundler gem. I would receive the following error:

$ gem install bundler

~/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]

this issue is described in a number of locations, including:

  • ruby-enterprise 1.8.7-12: timeout.rb:60: [BUG] Segmentation fault
  • Ruby gem install is seg faulting
  • rvm install rbx fails on archlinux (mri 1.8 + gcc 4.7 issue)
  • ruby1.8: segfaults when compiled with gcc-4.7
  • Ruby 1.8.7 fails to build (Arch Linux, gcc > 4.6)

回答1:


The description of the problem in the links in the original question suggest installing older versions of gcc to build 1.8.7, this is not necessary.

$ rvm remove 1.8.7
$ CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rvm install 1.8.7
$ rvm use 1.8.7
$ gem install bundler

Solution derived from the following:

Bug #6383: Segfault in Timeout module when compiled with GCC 4.7




回答2:


Also, I would ensure that you have the stable release that was released as of today, May 30, 2012 which is 4.7.0 and NOT one of the previous 4.7 releases which were not stable releases. RVM has a policy of not supporting non-stable-releases (aka development versions) of GCC for the reason that, well we're not compiler guys hehe.

Then, in addition, please uninstall and reinstall your original version of 1.8.7. Another option is to 'rvm reinstall 1.8.7' though not all previous configure options may be regenerated to include acceptance of the changed CFLAGS variable, as written to the config. @mpapis, do we need to advocate use of the --autoconf --force here?

(mpapis and I are devs on the RVM Project so this is as good a place as any to discuss flags and monitor to see which should be done so we can push the info to anyone else that comes to us about this)



来源:https://stackoverflow.com/questions/10820323/install-bundler-using-rvm-ruby-1-8-7-with-gcc-4-7-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!