我尝试了不同的方法来安装导轨,但从来没有得到它..每次我输入“gem install rails”..它告诉我"ERROR: Failed to build gem native extension."
miketeki-iphone:~ Simon$ gem install rails
Failed to load /Users/Simon/.gemrc because it doesn't contain valid YAML hash
Fetching: i18n-0.6.5.gem (100%)
Successfully installed i18n-0.6.5
Fetching: multi_json-1.7.9.gem (100%)
Successfully installed multi_json-1.7.9
Fetching: tzinfo-0.3.37.gem (100%)
Successfully installed tzinfo-0.3.37
Fetching: minitest-4.7.5.gem (100%)
Successfully installed minitest-4.7.5
Fetching: atomic-1.1.13.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/Users/Simon/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/Simon/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
/Users/Simon/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/Simon/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from /Users/Simon/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:817:in `try_run'
from extconf.rb:24:in `<main>'
Gem files will remain installed in /Users/Simon/.rvm/gems/ruby-2.0.0-p247@global/gems/atomic-1.1.13 for inspection.
Results logged to /Users/Simon/.rvm/gems/ruby-2.0.0-p247@global/gems/atomic-1.1.13/ext/gem_make.out
提前致谢。