You are not logged in.

#1 2012-04-13 05:38:53

bradmccormack
Member
Registered: 2012-04-13
Posts: 7

[SOLVED] Ruby gem install is seg faulting

Hello,

I've searched the forums and cannot find an answer.

I'm trying to get redmine going on Arch and have tried many different guides but I'm having no luck.
I cannot directly install gems as they all segfault and I've tried doing it via the packages on AUR which in the end have dependency issues for me.

Any advice please?


Example usage

gem install rake

output
/opt/ruby1.8/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]

Details

uname -r
3.0.18-linode43

ruby-1.8 --version
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]

gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]
  - INSTALLATION DIRECTORY: /opt/ruby1.8/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /opt/ruby1.8/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/ruby1.8/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /opt/ruby1.8/lib/ruby/gems/1.8
     - /home/xxx/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

References
https://wiki.archlinux.org/index.php/Redmine_setup
http://slopjong.de/2012/01/07/arch-linu … th-sqlite/
http://www.muddygoat.org/articles/pacgem
http://dthpham.com/76985040

Last edited by bradmccormack (2012-04-16 06:45:48)

Offline

#2 2012-04-13 16:43:33

synthead
Member
From: Seattle
Registered: 2006-05-09
Posts: 1,326

Re: [SOLVED] Ruby gem install is seg faulting

Seeing the same thing with ruby-enterprise.  Apparently, it has to do with an incompatibility with glibc 2.15.  I hope this gets fixed soon, I have a pressing issue to solve as a developer at my job :s


Touch my kernel

Offline

#3 2012-04-13 19:28:13

bradmccormack
Member
Registered: 2012-04-13
Posts: 7

Re: [SOLVED] Ruby gem install is seg faulting

Do you know if we can swap out glibc with an older version or similar to resolve this?

Thanks for replying

Offline

#4 2012-04-16 06:45:16

bradmccormack
Member
Registered: 2012-04-13
Posts: 7

Re: [SOLVED] Ruby gem install is seg faulting

Hi there,

The problem was the binaries that gcc 4.7 is producing seg fault. To resolve this I ended up installing an older gcc (4.4 in my case) and rebuilt ruby.
Everything worked correctly :-)

Issue solved. No more seg faulting and gems install nicely.

Offline

#5 2012-04-16 10:55:57

mavenik
Member
Registered: 2012-04-16
Posts: 2

Re: [SOLVED] Ruby gem install is seg faulting

I just installed Arch and encountered this problem.

Going by your solution, I referred this doc at https://wiki.archlinux.org/index.php/Do … er_Version for downgrading GCC but haven't been able to do so. It would be great if you could provide some instructions on how to downgrade gcc version from 4.7 to 4.4.

Offline

#6 2012-04-16 22:06:01

bradmccormack
Member
Registered: 2012-04-13
Posts: 7

Re: [SOLVED] Ruby gem install is seg faulting

Hi mavenik,

Whilst it is not the best way to do it, the following worked for me

1) install gcc44 from AUR (you can probably use gcc45 too). If you are not sure how to do that please search the forums for installing from Aur or Aur wrappers (I use packer)

 packer -S gcc44.

2) After it is installed temporarily rename your current gcc (4.7.x) 

 sudo mv /usr/bin/gcc /usr/bin/gcc4.7 

3) create a symlink to gcc4.4.x

 sudo ln -s /opt/gcc-4.4/gcc /usr/bin/gcc 

Test gcc version by doing

 gcc --version 

It should say 4.4.6 or similar

4) install ruby1.8 or ruby-enterprise from Aur (if this is required for redmine)

 packer -S ruby-enterprise 

ruby will now be compiled using an older version of gcc and gems will install correctly.

5) delete the symlink

 sudo unlink /usr/bin/gcc 

6) rename gcc4.7 back to gcc

 sudo mv /usr/bin/gcc4.7 

Test the version again to make sure it has reverted.


Please note the proper way to do this would be to set ruby1.8 / ruby-enterprise to compile with the older gcc by setting CC in the pkgbuild.
I'm not sure how to do that (had no luck) so the hacky solution above worked for me.

Please check each command above before you use it to make sure it is safe and valid for you.
Enjoy !

Offline

#7 2012-04-17 10:58:20

mavenik
Member
Registered: 2012-04-16
Posts: 2

Re: [SOLVED] Ruby gem install is seg faulting

Hi,

Thanks for the reply. I ran into a few errors but got things working with gcc4.5.

smile

Offline

#8 2012-04-20 03:32:18

bradmccormack
Member
Registered: 2012-04-13
Posts: 7

Re: [SOLVED] Ruby gem install is seg faulting

Cool!

Did you do it the hacky way above or set CC in the pkgbuild?

Offline

#9 2012-04-22 17:48:45

synthead
Member
From: Seattle
Registered: 2006-05-09
Posts: 1,326

Re: [SOLVED] Ruby gem install is seg faulting

bradmccormack wrote:

Hi mavenik,

Whilst it is not the best way to do it, the following worked for me

1) install gcc44 from AUR (you can probably use gcc45 too). If you are not sure how to do that please search the forums for installing from Aur or Aur wrappers (I use packer)

 packer -S gcc44.

2) After it is installed temporarily rename your current gcc (4.7.x) 

 sudo mv /usr/bin/gcc /usr/bin/gcc4.7 

3) create a symlink to gcc4.4.x

 sudo ln -s /opt/gcc-4.4/gcc /usr/bin/gcc 

Test gcc version by doing

 gcc --version 

It should say 4.4.6 or similar

4) install ruby1.8 or ruby-enterprise from Aur (if this is required for redmine)

 packer -S ruby-enterprise 

ruby will now be compiled using an older version of gcc and gems will install correctly.

5) delete the symlink

 sudo unlink /usr/bin/gcc 

6) rename gcc4.7 back to gcc

 sudo mv /usr/bin/gcc4.7 

Test the version again to make sure it has reverted.


Please note the proper way to do this would be to set ruby1.8 / ruby-enterprise to compile with the older gcc by setting CC in the pkgbuild.
I'm not sure how to do that (had no luck) so the hacky solution above worked for me.

Please check each command above before you use it to make sure it is safe and valid for you.
Enjoy !

You should be able to compile with the older gcc by putting CC=/path/to/your/compiler right before "make", like so:
CC=/opt/gcc-4.4/gcc make

YEAH! I got it working!  Here's what I did: install "gcc45" from the AUR, then compile ruby-enterprise by downloading the AUR package and running:

CC=gcc-4.5 makepkg

... then install the package.  IT WORKS!

Last edited by synthead (2012-04-23 13:52:39)


Touch my kernel

Offline

#10 2012-04-30 05:45:23

bradmccormack
Member
Registered: 2012-04-13
Posts: 7

Re: [SOLVED] Ruby gem install is seg faulting

Nice.

Offline

Board footer

Powered by FluxBB