BUG Bus Error ruby 1.8.7

前端 未结 7 767
自闭症患者
自闭症患者 2020-12-08 01:16

I\'m getting an error after compiling Ruby 1.8.7 using RVM on Lion 10.7.1 with Xcode 4.2 GM (new MacBook).

It compiles fine but when I try to install any gem I get t

相关标签:
7条回答
  • 2020-12-08 01:49

    I need to use Xcode on this machine, so the standalone gcc wasn't quite going to do it for me.

    Per other posters, I followed the suggestions at the end of the RVM update's release notes.

    Note, I didn't need to remove RVM. I was successful with a removal of Xcode 4.2.1 (completely), and a reinstall of Xcode 4.1, then doing the CC=/usr/bin/gcc-4.2 rvm install 1.8.7 trick. In my case I put export CC="/usr/bin/gcc-4.2" in my profile to save some typing while also setting up various gems.

    This also worked for Ruby Enterprise Edition (ree-1.8.7-2011.03) which had been failing as well.

    0 讨论(0)
  • 2020-12-08 02:01

    So nuking RVM (rvm implode) and reinstalling didn't make any difference. I ended up installing Xcode 4.2 and then installing the GCC compilers after which overrides the Xcode compilers.

    Here are the steps for those Googling this.

    1. Install Xcode 4.2.x

    2. Install GCC standalone compilers from https://github.com/kennethreitz/osx-gcc-installer

      Note: Xcode 4.3 beta was recently released. I'm testing if this fixes the compilation issues.

    0 讨论(0)
  • 2020-12-08 02:09

    You can download find stand alone GCC installer instructions here: https://github.com/kennethreitz/osx-gcc-installer

    This gives you a non llvm based gcc installation without having to mess around with Xcode.

    You can then use the command

     export CC=/usr/bin/gcc-4.2 
    

    This allows you to have the latest X Code for OSX purposes and still have a happy gcc version for ruby.

    0 讨论(0)
  • 2020-12-08 02:09

    The rvm post-install documentation says:

    ** Lion Users: DO NOT use Xcode Version 4.2.x for OS X Lion. It currently fails to build several rubies and gems, as well as several Homebrew and Macports packages as well. Xcode Version 4.1 (4B110) works. You can find Xcode 4.1 for OS X Lion at: https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.1_for_lion/xcode_4.1_for_lion.dmg

    This worked for me.

    0 讨论(0)
  • 2020-12-08 02:10

    Multiple articles suggest that Ruby doesn't like being compiled with LLVM being involved. The stopgap measure is to thoroughly remove the RVM install – the linked articles say how – and then recompile Ruby with plain GCC. The real fix will have to come from Apple/LLVM or the Ruby team.

    0 讨论(0)
  • 2020-12-08 02:10

    I fix that by

    1. installing Xcode 4.2.x,
    2. adding export CC=gcc into ~/.bash_profile,
    3. Reloading environment (source ~/.bash_profile),
    4. executing rvm install 1.9.3,
    5. executing rvm ruby-1.9.3-rc1,
    6. executing gem update --system and finally
    7. executing gem install bundler

    The problem is with Xcode 4.2.x version. If you run rvm get head you will see this message "DO NOT use Xcode Version 4.2.x. It currently fails to build several rubies and gems...".

    I don't have solution for ruby v1.8.7.

    I hope it helps.

    0 讨论(0)
提交回复
热议问题