每次克隆项目时,我一直在控制台上运行bundle install时遇到问题。但是如果我创建自己的项目,我在运行bundle install时没有遇到任何问题。
任何人都知道了什么?
Fetching gem metadata from http://rubygems.org/
Fetching version metadata from http://rubygems.org/
Fetching dependency metadata from http://rubygems.org/
Resolving dependencies....
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using coderay 1.1.1
Using debug_inspector 0.0.2
Using bundler 1.12.5
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using sass 3.4.22
Using tilt 2.0.5
Using spring 1.7.2
Installing sqlite3 1.3.11 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Applications/rubystack-2.2.5-3/ruby/bin/ruby -r ./siteconf20160708-85177-1q2ntd0.rb 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=/Applications/rubystack-2.2.5-3/ruby/bin/$(RUBY_BASE_NAME)
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
/Applications/rubystack-2.2.5-3/ruby/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 /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:1113:in `block in find_header'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:1112:in `find_header'
from extconf.rb:30:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Applications/rubystack-2.2.5-3/ruby/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.11 for inspection.
Results logged to /Applications/rubystack-2.2.5-3/ruby/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-10/2.2.0-static/sqlite3-1.3.11/gem_make.out
Using turbolinks-source 5.0.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Installing nokogiri 1.6.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Applications/rubystack-2.2.5-3/ruby/bin/ruby -r ./siteconf20160708-85177-1kbeqyk.rb extconf.rb --with-opt-dir=/usr
Using pkg-config version 1.1.7
checking if the C compiler accepts -I/Applications/rubystack-2.2.5-3/common/include/ImageMagick -I/Applications/rubystack-2.2.5-3/common/include -I/Applications/rubystack-2.2.5-3/common/include/ImageMagick -I/Applications/rubystack-2.2.5-3/common/include -I/Applications/rubystack-2.2.5-3/sqlite/include -I/Applications/rubystack-2.2.5-3/varnish/include -I/Applications/rubystack-2.2.5-3/python/include -I/Applications/rubystack-2.2.5-3/mysql/include -I/Applications/rubystack-2.2.5-3/postgresql/include -I/Applications/rubystack-2.2.5-3/apache2/include -I/Applications/rubystack-2.2.5-3/subversion/include -I/Applications/rubystack-2.2.5-3/common/include -I/usr/include -m64... *** 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
--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=/Applications/rubystack-2.2.5-3/ruby/bin/$(RUBY_BASE_NAME)
--help
--clean
/Applications/rubystack-2.2.5-3/ruby/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 /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:571:in `block in try_compile'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:522:in `with_werror'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:571:in `try_compile'
from extconf.rb:138:in `nokogiri_try_compile'
from extconf.rb:162:in `block in add_cflags'
from /Applications/rubystack-2.2.5-3/ruby/lib/ruby/2.2.0/mkmf.rb:619:in `with_cflags'
from extconf.rb:161:in `add_cflags'
from extconf.rb:414:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Applications/rubystack-2.2.5-3/ruby/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.8 for inspection.
Results logged to /Applications/rubystack-2.2.5-3/ruby/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-10/2.2.0-static/nokogiri-1.6.8/gem_make.out
Using rack-test 0.6.3
Using mime-types 3.1
Using better_errors 2.1.1
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using uglifier 3.0.0
Using sprockets 3.6.3
An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
continue.
Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
我试图运行在github上传的ruby项目文件,我能够成功克隆它,我知道我应该在我能够执行之前安装宝石{ {1}}但每次我尝试运行rails s
时,它都会给我一长串代码^
但是,每当我使用bundle install
创建自己的项目时,我都能正确执行rails new ___
,请安装宝石并执行bundle install
我不会理解为什么当我克隆另一个项目时它不起作用。
更新:
当我尝试运行rails s
时,这就是它给我的东西
gem install sqlite3 -- --with-sqlite3-dir=/opt/local
答案 0 :(得分:0)
检查你的sqlite的安装位置并运行以下命令(我假设/opt/local
)
gem install sqlite3 -- --with-sqlite3-dir=/opt/local
并运行bundle install
答案 1 :(得分:0)
安装sqlite3 gem时,原生扩展失败。这意味着您需要安装系统库。
运行:
ubuntu上的 sudo apt-get install sqlite3
brew install sqlite3
不确定窗户。
此类错误&#34;未能构建原生扩展&#34;在安装Ruby gem时很常见。您有时需要通过一些环节来安装本机扩展。通常,您会遇到很长的错误,而这些错误最初似乎并不能提供很多有用的信息。尝试在错误中找到一行,表示缺少库,然后在Internet上搜索该行并确定需要安装的内容。