繁体   English   中英

命令行gem安装错误-sqlite3-Rails新命令

[英]Command line gem install error - sqlite3 - Rails New Command

我尝试在命令行中创建新的Rails应用程序,并遇到以下错误。 有什么问题?

我已经尝试过自己解决问题,但是我是编码的新手,即使阅读它,我也完全迷失了!

 /Users/johnsway/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
    checking for sqlite3.h... *** 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/johnsway/.rvm/rubies/ruby-2.1.2/bin/ruby
    --with-sqlite3-dir
    --without-sqlite3-dir
    --with-sqlite3-include
    --without-sqlite3-include=${sqlite3-dir}/include
    --with-sqlite3-lib
    --without-sqlite3-lib=${sqlite3-dir}/lib
/Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.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/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:1120:in `block in find_header'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
    from /Users/johnsway/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:1119:in `find_header'
    from extconf.rb:30:in `<main>'

extconf failed, exit code 1

如果您还有其他需要,请随时询问!

谢谢您的帮助!

也许这个问题与XCode的最新更新有关。 更新XCode之后,您需要执行以下步骤:

  1. 打开Xcode并接受许可协议
  2. 重新安装命令行工具。

第二步似乎取决于您的操作系统版本。 如果xcode-select --install不起作用,请尝试在/System/Library/CoreServices启动“ Install Command Line Developer Tools应用程序。

重新安装命令行工具后,尝试重新运行bundle install

暂无
暂无

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

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