简体   繁体   中英

Installation of Rails

I tried to install Rails on OS X Lion using the following command in Terminal:

sudo gem install rails

But I am getting the following error:

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

   /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
    mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


 Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.6 for inspection.
  Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.6/ext/json/ext/generator/gem_make.out

Any help would be appreciated.

First install the Command Line Tools in the latest Xcode-Version .

and then run sudo gem install rails

To install Command Line Tools, go to XCode Preferences > Downloads.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM