简体   繁体   English

Rails安装失败。

[英]Rails installation failure.

I am trying to install rails and I keep getting the following error, I have install developer tools but this didn't fix the problem. 我正在尝试安装Rails,但不断出现以下错误,我已经安装了开发人员工具,但这不能解决问题。

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

/Users/stel/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150928- 21021-11g7r42.rb extconf.rb
checking if the C compiler accepts ... *** 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/stel/.rvm/rubies/ruby-2.2.1/bin/$(RUBY_BASE_NAME)
--help
--clean
/Users/stel/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/stel/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/mkmf.rb:571:in `block in try_compile'
from /Users/stel/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/mkmf.rb:522:in `with_werror'
from /Users/stel/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/mkmf.rb:571:in `try_compile'
from extconf.rb:80:in `nokogiri_try_compile'
from extconf.rb:87:in `block in add_cflags'
from /Users/stel/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/mkmf.rb:619:in `with_cflags'
from extconf.rb:86:in `add_cflags'
from extconf.rb:337:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/stel/.rvm/rubies/ruby-  2.2.1/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Users/stel/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/nokogiri-1.6.6.2/gem_make.out
Petross-Mini:~ stel$ bundle config build.nokogiri --use-system-libraries
-bash: bundle: command not found

You have to install ruby with rvm or rbenv . 您必须使用rvm或rbenv安装ruby。 Otherwise It will create a problem. 否则会产生问题。 Use the following steps. 使用以下步骤。

#Install rvm
\curl -sSL https://get.rvm.io | bash -s stable

#Install ruby version 2.0.0-p451
rvm install ruby-2.0.0-p451

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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