2

I'm very new to OS X and RoR and ran into a few errors while following Hartl's RoR Tutorial.

I've installed Git and RVM but am getting errors while installing Ruby - and consequently can't install Ruby Gems and Rails either.

I've read the log files but can't figure out what the issue is...it seems my machine can't run make and has issues with --version. Some files don't exist either.

Much thanks for your help :)

User-MacBook-Air:~ haseebjaved$ rvm install 1.9.2
Fetching yaml-0.1.4.tar.gz to /Users/haseebjaved/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/haseebjaved/.rvm/src
Configuring yaml in /Users/haseebjaved/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/haseebjaved/.rvm/usr"  ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/yaml/configure.log
Compiling yaml in /Users/haseebjaved/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/yaml/make.log

Database file /Users/haseebjaved/.rvm/config/packages does not exist.

/Users/haseebjaved/.rvm/scripts/functions/build: line 28: --version: command not found
Installing Ruby from source to: /Users/haseebjaved/.rvm/rubies/ruby-1.9.2-p318, this may take a while depending on your cpu(s)...

ruby-1.9.2-p318 - #fetching 
ruby-1.9.2-p318 - #extracted to /Users/haseebjaved/.rvm/src/ruby-1.9.2-p318 (already extracted)
ruby-1.9.2-p318 - #configuring 
Error running ' ./configure --prefix=/Users/haseebjaved/.rvm/rubies/ruby-1.9.2-p318 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/haseebjaved/.rvm/usr ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/configure.log
There has been an error while running configure. Halting the installation.
/Users/haseebjaved/.rvm/scripts/functions/build: line 28: --version: command not found
6
  • 1
    which version of XCode are you using? If you have XCode > 4.1 I suggest you to downgrade otherwise you will be able to compile only ruby 1.9.3 and lots af gem will give you trubbles. Install XCode 4.1 and export CC=/usr/bin/gcc-4.2 this will allow you to compile ruby with rvm.
    – nolith
    Mar 13, 2012 at 8:34
  • Hi Nolith thank you for your reply. I have installed XCode 4.3.1. How can I downgrade to 4.1? Basically I'm trying to run 'rvm install 1.8.7' and then run 'rvm install 1.9.2', as directed by Hartl's tutorial but I get different errors when I execute both install commands...for 'rvm install 1.8.7', i get the error 'Error running 'patch -F 25 -p1 -N -f <"/Users/haseebjaved/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"', please read /Users/haseebjaved/.rvm/log/ruby-1.8.7-p358/patch.apply.stdout-rouge-fix.log'
    – hjaved
    Mar 13, 2012 at 21:38
  • and the second error i get for 'rvm install 1.8.7' is Error running ' ./configure --prefix=/Users/haseebjaved/.rvm/rubies/ruby-1.8.7-p358 --enable-shared --disable-install-doc ', please read /Users/haseebjaved/.rvm/log/ruby-1.8.7-p358/configure.log There has been an error while running configure. Halting the installation.
    – hjaved
    Mar 13, 2012 at 21:43
  • With XCode 4.3.1 you cannot install ruby < 1.9.3 (and lots of gems will not work). You have to remove (just trash it) XCode from /Applications and search for a XCode 4.1 installer (It can be found on developer.apple.com you have to login with a developer id and search the download area for XCode 4.1)
    – nolith
    Mar 14, 2012 at 9:43
  • thank you. I can't find XCode 4.1 on the developer site. Can you see it or do you think they removed it?
    – hjaved
    Mar 14, 2012 at 19:40

1 Answer 1

2

You do not have any compiler installed, your best choice is osx-gcc-installer, it will provide you all tools needed for compilation.

Also be sure to not play with Xcode above 4.1 - it does not provide GCC compiler (only LLVM), and even ruby-1.9.3-p125 is not fully ready for clang(LLVM) so expect erros with it.

You can open a ticket to fix the msg to be more informative - I should be able to improve it.

5
  • The OSX GCC installer is no longer the best solution on OS X Lion, you should instead use the Command Line Tools for Xcode available from developer.apple.com/downloads/index.action Mar 13, 2012 at 14:39
  • 1
    sorry but you are not right, unfortunately ruby-1.9.3-p125 has issues with clang, and using clang with any earlier ruby version will generate error, it possibly could compile, but a lot of strange bugs will pop up. Of course the Command Line Tools will compile fine most of the stuff in homebrew (after you install autoconf) but it will not install ruby properly.
    – mpapis
    Mar 13, 2012 at 17:39
  • Hi i have installed XCode 4.3.1 but am getting errors when I run 'rvm install 1.8.7' and then 'rvm 1.9.2' as directed in hartl's tutorial. I receive different errors for these two commands. Thanks for your time and help.
    – hjaved
    Mar 14, 2012 at 1:25
  • @hjaved updated my answer, ruby is not yet compatible with Xcode 4.3.1.
    – mpapis
    Mar 14, 2012 at 2:25
  • thank you i deleted 4.3.1 and installed 4.1 and was able to install both Ruby and Rails.
    – hjaved
    Mar 15, 2012 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.