这是我的错误: C:>gem install sqlite3-ruby 临时增强 PATH 以包含 DevKit... 构建本机扩展。这可能需要一段时间... 错误:安装 sqlite3-ruby 时出错:错误:无法构建 gem 原生扩展。
C:/Ruby200-x64/bin/ruby.exe extconf.rb
检查 sqlite3.h... * extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件。检查 mkmf.log 文件以获取更多详细信息。您可能需要配置选项。
提供的配置选项: --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=C:/Ruby200-x64/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}/ --enable-local --disable-local C:/Ruby200-x64/lib/ruby/2.0.0 /mkmf.rb:431:in try_do': The compiler failed to ge
nerate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:562:in
try_cpp' from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1086:in block in find_header
'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:892:in
block in checks_for' from C:/Ruby200-x64/lib/ruby/2.0 .0/mkmf.rb:337:inblock (2 levels) in p
ostpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:307:in
从 C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:337:inblock in postpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:307:in
打开' 从 C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:333: in 打开'postpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:891:in
来自 C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1085:in 的检查_for find_header'
from extconf.rb:34:in
'
Gem 文件将继续安装在 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlit e3-1.3.7 以供检查。结果记录到 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
宝石文件:来源“ https://rubygems.org ”
gem 'rails'
gem 'jquery-rails'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby'
gem 'faker', '1.0.1'
gem 'will_paginate'
gem 'bootstrap-will_paginate', '0.0.5'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.12.2'
gem 'guard-rspec', '0.5.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '1.4.0'
gem 'cucumber-rails', '1.2.1', require: false
gem 'database_cleaner', '0.7.0'
gem 'rb-fsevent', '0.4.3.1', :require => false
gem 'growl', '1.0.3'
gem 'guard-spork', '0.3.2'
gem 'spork', '0.9.2'
gem 'launchy', '2.1.0'
gem 'ffi', '1.1.0'
end
我已经安装了 DevKit。我正在运行 ruby 2.0.0。一切都在 Ruby 1.9.3 上完美运行。谁能帮我?
我尝试过的事情:
1. bundle install (I do not know why it just skips sqlite3)
2. gem install sqlite3
3. gem install sqlite3-ruby
4. I've also included the -- --with-sqlite3-dir=/usr/local/lib on each of those lines
当我进行捆绑安装时,它会跳过 sqlite3 gem 并正常安装所有其他 gem。
我已经安装了 devkit,然后我去了 sqlite3 网站,得到了 windows 的 .dll 和 exe 文件,并将它放在我的 ruby2.0 bin 文件夹中。
编辑:另外,当我运行 rails server 并加载 locahost:3000 时,它告诉我运行 gem install activerecord-sqlite3-adapter
当我运行它时,它说没有这样的 gem 并将其包含在我的 gemfile 中,但它包含在我的 gemfile 中。