在Linux上使用rvm,ruby 1.8.7和gcc 4.7安装bundler [英] install bundler using rvm, ruby 1.8.7 with gcc 4.7 on linux
问题描述
在linux(Fedora 17,Arch等)上编译ruby 1.8.7或者安装GCC 4.7的bundle gem。这个问题发生在我使用RVM的时候。我能够安装1.8.7,但无法安装捆绑软件宝石。我会收到以下错误:
$ p $ $ gem install bundler
〜/ .rvm / rubies / ruby-1.8.7-p358 / lib / ruby / 1.8 / timeout.rb:60:[BUG]分割错误
ruby 1.8.7(2012-02-08 patchlevel 358)[x86_64-linux]
这个问题在很多地方都有描述,包括:
- ruby-enterprise 1.8.7-12:超时。 rb:60:[BUG]分段错误
- Ruby gem install is seg错误
- rvm在archlinux上安装rbx失败(mri 1.8 + gcc 4.7问题)
- ruby1.8:使用gcc-4.7编译时的段错误
- Ruby 1.8.7无法构建(Arch Linux,gcc> 4.6)
原始问题链接中的问题描述建议安装旧版本的gcc以构建1.8.7,这不是必需的。
$ rvm删除1.8.7
$ CFLAGS = - O2 -fno-tree-dce -fno-optimize rm安装1.8.7
$ rvm使用1.8.7
$ gem install bundler
解决方案源自以下内容:
Bug#6383:使用GCC 4.7编译时超时模块中的Segfault
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)
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
这篇关于在Linux上使用rvm,ruby 1.8.7和gcc 4.7安装bundler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!