Recently I upgraded to Mountain Lion (OK actually not quite recent XD), which kind of resets my development environment. But it's okay, not a big deal :)
Rails 3.2.8 is out, and it fixes 3 security issues. So it should be worth to upgrade ChordsPresent's rails version. However it seems I could not get it done very easy (I expected less than 1 minute, but actually took me nearly 5 minutes...)
gem 'rails', '3.2.8' in the Gemfile and ran
bundle update rails, I get the following error:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [generator.o] Error 1
Gem files will remain installed in /Users/PeterWong/.rvm/gems/ruby-1.9.3-head@chordspresent/gems/json-1.7.4 for inspection.
Results logged to /Users/PeterWong/.rvm/gems/ruby-1.9.3-head@chordspresent/gems/json-1.7.4/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.7.4), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.4'` succeeds before bundling.
Basically it complained that it cannot find my gcc at /usr/bin/gcc-4.2.
The first response I took was
which gcc which yields:
/usr/bin/gcc. But then I realised that it should not be that simple. Mountain Lion changed to llvm-gcc.
And my curiosity caused me to type
ls /usr/bin/llvm-gcc together with two tabs and it showed the two results:
Still do not know why
bundle update wanted gcc-4.2 yet, but it should work if I just make a symbolic link:
sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
And yeah it works now,
bundle update rails ran successfully now :)