Jack comes to code

Ruby / Rails / Sinatra / APIs

Upgrading to Mountain Lion(2)

With basic fix from (1) of Mountain Lion for Rails projects, most of application should run as well as in Lion. While bad things always happen unexpectedly. When creatig a new rails app, or adding a new ruby version to RVM, some exceptions would be like this:

1
2
3
4
5
6
7
8
9
10
11
Installing json (1.7.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
        C:/Programozas/Ruby192/bin/ruby.exe extconf.rb
creating Makefile

make
'make' is not recognized as an internal or external command, operable program or batch file.


Gem files will remain installed in C:/Programozas/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.7.4 for inspection.

Believe above is one of the gem version using make, which is somehow not defined as the command it should have been. The reasons are you miss GCC 4.2 (if you are using a ruby version older than 1.9.3) and Apple sets the ownership of /usr/local to root. Commands to go:

1
2
3
4
> sudo chown -R `whoami` /usr/local
> brew tap homebrew/dupes
> brew install apple-gcc42
> sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

Unfortunately, now when you install or reinstall a ruby version with RVM, there are still weird errors. Even if many people are happy with work-around solutions like:

http://stackoverflow.com/questions/11660673/install-ree-1-8-7-with-rvm-on-mountain-lion

http://stackoverflow.com/questions/11664835/mountain-lion-rvm-install-1-8-7-x11-error

You can try them, but neither work for me. My last approach is to reinstall RVM from (1.10 to 1.14), then rejoice!

1
2
> rvm implode
> curl -L https://get.rvm.io | bash -s stable

(You may be unhappy with the last solution, but I guess Mountain Lion users need to do so soon or later)