Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails does not work on Lion

I changed my Mac OSX version to Lion. However I cannot create a Rails3 app.

I use rvm 1.9.2 and i choose ruby 1.9.2-p290 to create Rails 3 app.

Everything seems okey. When I start to create a new app

rails new new_my_app

I see this errors,

Installing json (1.6.6) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/ender/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
creating Makefile

make
sh: make: command not found


Gem files will remain installed in /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6 for inspection.
Results logged to /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6/ext/json/ext/generator/gem_make.out
An error occured while installing json (1.6.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.6'` succeeds before bundling.

When I try

gem install json -v '1.6.6'

I face this errors

Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

        /Users/ender/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
creating Makefile

make
sh: make: command not found


Gem files will remain installed in /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6 for inspection.
Results logged to /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6/ext/json/ext/generator/gem_make.out

What should I do to fix this problem?

Thanks.

like image 224
eayurt Avatar asked Dec 16 '22 01:12

eayurt


2 Answers

You need to install "Command Line Tools" from preferences in Xcode 4 for Lion.

like image 186
gok Avatar answered Feb 21 '23 09:02

gok


You need to install osx-gcc-installer

If you migrated ruby from previoys system you need to reinstall ruby and gems:

rvm reinstall 1.9.2
rvm use 1.9.2
rvm gemset pristine
like image 21
mpapis Avatar answered Feb 21 '23 07:02

mpapis