Can't install Ruby Enterprise Edition with RVM on OSX Lion
Asked Answered
S

8

44

Here is what I have done so far.

  1. Clean install of OS X Lion
  2. Downloaded and installed latest version of Xcode from the App Store.
  3. Installed Git
  4. Installed Homebrew
  5. Installed RVM

I am now trying to install Ruby Enterprise Edition for a project with rvm install ree and receive the following error:

$ rvm install ree
ree-1.8.7-2011.03 - #installing
ERROR: Error running './installer -a /Users/FaraazKhan/.rvm/rubies/ree-1.8.7-2011.03
  --no-tcmalloc --dont-install-useful-gems ', please read
  /Users/FaraazKhan/.rvm/log/ree-1.8.7-2011.03/install.log
ERROR: There has been an error while trying to run the ree installer. Halting
  the installation.

I have already tried CC=/usr/bin/gcc-4.2 rvm install ree and with the same result.

Sulphonamide answered 24/7, 2011 at 0:27 Comment(7)
What does /Users/FaraazKhan/.rvm/log/ree-1.8.7-2011.03/install.log say?Gorgerin
Here is the output of cat /Users/FaraazKhan/.rvm/log/ree-1.8.7-2011.03/install.log [2011-07-23 20:16:52] ./installer -a /Users/FaraazKhan/.rvm/rubies/ree-1.8.7-2011.03 --no-tcmalloc --dont-install-useful-gems Welcome to the Ruby Enterprise Edition installer This installer will help you install Ruby Enterprise Edition 1.8.7-2011.03. Don't worry, none of your system files will be touched if you don't want them to, so there is no risk that things will screw up.Sulphonamide
You can expect this from the installation process: 1. Ruby Enterprise Edition will be compiled and optimized for speed for this system. 2. Ruby on Rails will be installed for Ruby Enterprise Edition. 3. You will learn how to tell Phusion Passenger to use Ruby Enterprise Edition instead of regular Ruby. Press Enter to continue, or Ctrl-C to abort. Checking for required software...Sulphonamide
* C compiler... found at /usr/bin/gcc-4.2 * C++ compiler... found at /usr/bin/g++ * The 'make' tool... found at /usr/bin/make * The 'patch' tool... found at /usr/bin/patch * Zlib development headers... found * OpenSSL development headers... found * GNU Readline development headers... foundSulphonamide
-------------------------------------------- Target directory Auto-installing to: /Users/FaraazKhan/.rvm/rubies/ree-1.8.7-2011.03 -------------------------------------------- Compiling and optimizing Ruby Enterprise Edition In the mean time, feel free to grab a cup of coffee.Sulphonamide
It looks like the source is already configured. Skipping configure script... /usr/bin/gcc-4.2 -dynamiclib system_allocator.c -install_name @rpath/libsystem_allocator.dylib -o libsystem_allocator.dylib mkdir -p .ext/common make PREINCFLAGS='-I/opt/local/include' PRELIBS='-L/opt/local/lib -Wl,-rpath,/Users/FaraazKhan/.rvm/rubies/ree-1.8.7-2011.03/lib -L/Users/FaraazKhan/.rvm/rubies/ree-1.8.7-2011.03/lib -lsystem_allocator' ./ext/purelib.rb:2: [BUG] Segmentation fault ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin11.0.0], MBARI 0x6770, Ruby Enterprise Edition 2011.03Sulphonamide
make: *** [.rbconfig.time] Abort trap: 6 @ChrisSulphonamide
W
85

I was able to duplicate your error, just now. This solved it for me:

$ rvm remove ree
$ export CC=/usr/bin/gcc-4.2
$ rvm install --force ree

Wobbly answered 24/7, 2011 at 1:27 Comment(7)
Thank you! I have installed rvm system-wide and used sudo CC=/usr/bin/gcc-4.2 rvm install --force reeKania
Hey Lorenz, I'm glad it worked. But fyi, you shouldn't need to use sudo to install rubies with a system-wide install. Make sure your user account is added to the rvm group (in /etc/group) and you should be golden to manage rubies with your non-privileged account.Wobbly
This fix worked for me as well. Installing ree with rvm on OSX Lion. 1.9.2-p290 and 1.9.3-preview1 both worked with my rvm install of all three. What I saw was that the ree install was using /usr/bin/gcc vs the export using /usr/bin/gcc-4.2. In case anyone needs to diagnose further. Thanks for your solution JofoCodin.Trust
Also, if you're having a readline issue, this worked for me: rvm install ree --force -C --with-readline-dir=$HOME/.rvm/usrFunctional
Did not work for me. Colleague downloaded and installed Lion and XCode last week. Today he tried to follow these instructions, but /usr/bin/gcc-4.2 does not exist. Where do we get it? Does this solution still work for other people?Sedgewinn
Just wanted to leave an update here that this solution won't work any longer for XCode 4.2.x. Starting with 4.2.1, XCode defaults to using the LLVM compiler and gcc-4.2 is not installed. See Alex Dixon's answer here for a solution: https://mcmap.net/q/375151/-bug-bus-error-ruby-1-8-7Wobbly
You can get gcc-4.2 from: github.com/kennethreitz/osx-gcc-installer/downloads. Once I got that installed, the above steps worked perfectly.Standstill
M
4

Using MacPorts you can install Ruby Enterprise Edition, as well as Ruby 1.9.2 for the local user in OS X Lion while having Xcode 4.2 installed by using "Apple's version of gcc 4.2."

Prerequisites:

  • OS X Lion (tested in 10.7.2)
  • Xcode 4.2
  • rvm 1.9.1
  • MacPorts 2.0.3

Execute the following commands:

$ sudo port install apple-gcc42

$ export CC=/opt/local/bin/gcc-apple-42

then

$ rvm install ree

$ rvm use ree

or

$ rvm install 1.9.2

$ rvm use 1.9.2

optionally

$ rvm use ree --default

or

$ rvm use 1.9.2 --default

I hope this helps.

-Joe

Monotone answered 30/10, 2011 at 6:9 Comment(3)
Using this solution does not require you to downgrade to Xcode 4.1 as others have stated.Monotone
sudo port install apple-gcc42 is very useful. Thank you.Ortega
Please note "port install apple-gcc42" creates a folder "gcc-apple-4.2", so the next line should be "export CC=/opt/local/bin/gcc-apple-4.2", it's easy to miss and get an errorLeclaire
S
4

No need to install MacPorts or downgrade to 4.1 to get GCC, I used the installer package at https://github.com/kennethreitz/osx-gcc-installer with xCode 4.2 already installed, and had no problem installing 1.9.2-head and 1.9.2-p290.

Spinthariscope answered 2/12, 2011 at 6:27 Comment(0)
P
2

Please do NOT use sudo with RVM, nor do you need to use rvmsudo EXCEPT for when upgrading RVM itself. Please see and read https://rvm.io/support/faq/ (Do I need to use sudo with gems? entry) and https://rvm.io/support/troubleshooting/ (Multi-User Installs - Using the sudo command entry)

Please remove your current installation and start over as using sudo will definitely mess up the permission structure for RVM. Please see the very bottom of https://rvm.io/support/troubleshooting/ (How do I completely clean out all traces of RVM from my system, including for system wide installs? entry)

Then begin again strictly following the Multi-User installation segment of https://rvm.io/rvm/install/

Thank you.

Perforce answered 9/10, 2011 at 17:30 Comment(0)
R
2

I did something similar to what jbg advised. Only I didn't use MacPorts. I just used the latest GCC package for Lion here.

This was after spending about a day and a half trying all of the other suggestions, downgrading to Xcode 4.1, etc. to no avail.

By the way, the direct link to Xcode 4.1 at Apple's site gave me an invalid checksum error, all three times I downloaded it. I saw a Twitter post from someone else who had the same problem.

Robinrobina answered 1/11, 2011 at 18:38 Comment(2)
This worked like a charm. After installing GCC package execute rvm install 1.9.3 --with-gcc=gcc-4.2 and you are set. Thanks user210977!Pew
You might appreciate this bash script I wrote to "automate" the process. It also ties in with a custom Soloist (Chef) recipe list. gist.github.com/1454081Robinrobina
P
2

At the risk of redundancy, I'll post my answer as well, since I tried everything on this page (and many others) and ended up with a hybrid of some of them which seemed the most likely to work. Note that some of these steps may not have been explicitly necessary but they were sufficient (i.e., I didn't go back and remove potentially unnecessary steps to get the simplest path to success).

Environment: Mac OS Lion 10.7.3, Homebrew components, rvm 1.10.2, ree 1.8.7-2012.01, Xcode 4.2.1 with legacy gcc-4.2 available.

Steps:

  1. Ensure that a stable Ruby is current. Used 1.9.2 (rvm use 1.9.2) as 1.9.3 was a potential problem.
  2. rm -fr $rvm_path/usr
  3. rvm pkg install ree_dependencies
  4. rvm remove ree
  5. export CC=/usr/bin/gcc-4.2
  6. rvm install ree \ --with-openssl-dir=$rvm_path/usr \ --with-readline-dir=$rvm_path/usr \ --with-iconv-dir=$rvm_path/usr \ --with-zlib-dir=$rvm_path/usr

I had previously tried the brew-specific solutions but those didn't work for me. Hope this helps someone!

Perfoliate answered 16/2, 2012 at 23:30 Comment(0)
D
1

If you are on Lion 10.7.2, and have installed XCode 4.2, you need to downgrade XCode to 4.1

Here's how I did it (it was more complicated than you might think):

  • Download XCode 4.1 from Apple Dev Center (you'll need to login with your dev centre creds)
  • uninstall XCode 4.2

    $ sudo /Developer/Library/uninstall-devtools --mode=all

  • remove the XCode installer from your /Applications directory

  • run the XCode 4.1 package you downloaded, this will install a new XCode installer into /Applications
  • run the XCode installer in /Applications
  • When it stops, asking you to quit iTunes, you need to quit iTunes, and also use Activity Monitor to force quit the iTunes Helper
  • Wait for XCode 4.1 to install
  • Use the steps outlined above to install ree

Cheers, Ian

Donella answered 26/10, 2011 at 9:55 Comment(0)
O
1

This is how i did to install it. May be previous answers are already solve your problem. My step may be help people who experience same as me.

Frist, Install MacPort latest version

>rvm uninstall ree
>sudo port install apple-gcc42
>export CC=/opt/local/bin/gcc-apple-4.2
>rvm pkg install zlib openssl readline
>rvm install --force ree

Result is:

IronB:~ ...$ rvm install --force ree
Installing Ruby Enterprise Edition from source to: /Users/.../.rvm/rubies/ree-1.8.7-2011.03
ree-1.8.7-2011.03 - #fetching (ruby-enterprise-1.8.7-2011.03)
ree-1.8.7-2011.03 - #extracting ruby-enterprise-1.8.7-2011.03 to /Users/.../.rvm/src/ree-1.8.7-2011.03
Applying patch 'tcmalloc' (located at /Users/.../.rvm/patches/ree/1.8.7/tcmalloc.patch)
Applying patch 'stdout-rouge-fix' (located at /Users/.../.rvm/patches/ree/1.8.7/stdout-rouge-fix.patch)
Applying patch 'no_sslv2' (located at /Users/.../.rvm/patches/ree/1.8.7/no_sslv2.diff)
ree-1.8.7-2011.03 - #installing 
Removing old Rubygems files...
Installing rubygems-1.8.10 for ree-1.8.7-2011.03 ...
Installation of rubygems completed successfully.
ree-1.8.7-2011.03 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ree-1.8.7-2011.03 - #importing default gemsets (/Users/.../.rvm/gemsets/)

I'm also put this to my ~/.rvmrc for next time

 # Make this work with OS X Lion... for now...
 if [[ `uname -v` =~ "Darwin Kernel Version 11" ]] ; then
       export CC=/opt/local/bin/gcc-apple-4.2
 fi
Ortega answered 3/12, 2011 at 9:8 Comment(1)
rvm pkg install zlib openssl readline was very useful, thanks!Upolu

© 2022 - 2024 — McMap. All rights reserved.