After a long time away from Rails and Ruby, I roll up my sleeves today and try to figure out what I’ve missed lately:
- first, Rails 3.2 proves to be engineered to work faster in dev mode, by now incorporating the
Active Reloadgem by default.
- then reading some more, Ruby 1.9.3 bubbles up — it’s freaking fast bro!
Great news, time for our good old friend RVM:
$ rvm get head
$ rvm reload
$ rvm install 1.9.3
Installing Ruby from source to: /Users/marius/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)... ruby-1.9.3-p0 - #fetching ruby-1.9.3-p0 - #extracted to /Users/marius/.rvm/src/ruby-1.9.3-p0 (already extracted) Fetching yaml-0.1.4.tar.gz to /Users/marius/.rvm/archives Extracting yaml-0.1.4.tar.gz to /Users/marius/.rvm/src Configuring yaml in /Users/marius/.rvm/src/yaml-0.1.4. Compiling yaml in /Users/marius/.rvm/src/yaml-0.1.4. Installing yaml to /Users/marius/.rvm/usr ruby-1.9.3-p0 - #configuring ERROR: Error running ' ./configure --prefix=/Users/marius/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/marius/.rvm/usr ', please read /Users/marius/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has been an error while running configure. Halting the installation.
The installer fails with an error message including
checking whether the C compiler works... no even with Xcode 4.2 available.
The Wrong Path
$ rvm reinstall 1.9.3 --with-gcc=clang
which didn’t work for me!
$ rvm reinstall 1.9.3
did the trick! So I was happy to jump to the next step:
$ rvm --default use 1.9.3
Downloading and installing the massive Xcode tool suite (2.5GB!!!) is a huge hassle if you just want GCC and related tools.
The osx-gcc-installer includes the essential compilers:
- Developer CLI Tools (purge, etc)
- DevSDK (headers, etc)
Therefore, since I’m not planning to use Xcode for other reasons, I simply removed it:
$ sudo /Developer/Library/uninstall-devtools –mode=all
If the Rails install fails with a message along these lines:
don't worry, just run the GCC Installer once again.
ERROR: Error installing rails: ERROR: Failed to build gem native extension. /Users/marius/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb creating Makefile make sh: make: command not found