Ticket #30275 (closed defect: fixed)
ruby: ruby gem installation causes segfaults
| Reported by: | dj_mook@… | Owned by: | kimuraw@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.0.99 |
| Keywords: | lion haspatch | Cc: | snc@… |
| Port: | ruby |
Description
If you install the ruby macport on lion and then install rubygems from source, any attempt to install a gem results in a segfault.
sudo gem install sinatra ruby-1.8.7-p352/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.0.0]
According to http://www.frymanet.com/2011/07/rvm-ruby-1-8-7-and-osx-lion/ ruby does not work well with the default llvm compiler in lion.
Using the solution from the article I patched the Portfile to set CC=/usr/bin/gcc-4.2 as a configure argument.
After rebuilding ruby with the new portfile and then installing rubygems from source, I can now install gems without problem.
Macports version 2.0 rc1.
Attachments
Change History
comment:1 Changed 4 years ago by macsforever2000@…
- Owner changed from macports-tickets@… to kimuraw@…
- Keywords haspatch added
comment:2 Changed 4 years ago by jmr@…
Does it work with clang? It's probably better to use it if it does.
comment:3 Changed 4 years ago by snc@…
- Cc snc@… added
I'm seeing this problem in snow leopard with llvm-gcc as well.
comment:4 Changed 4 years ago by snc@…
Using the configure.compiler clang macro suffices: ./configure correctly switches to clang.
comment:6 Changed 4 years ago by snc@…
This port builds successfully with configure.compilter gcc-4.2.
Should we test for the OS version to decide between gcc-4.2 and gcc-4.0? or just detect llvm/clang and switch it back if set?
comment:7 Changed 4 years ago by snc@…
Behold the hierarchy for picking default compilers.
Changed 4 years ago by snc@…
- Attachment ruby-snc.diff added
change configure.compiler to gcc-4.2 when defaulted to llvm-gcc-4.2 or clang

