尝试升级到最新版本的 Ruby on Rails。我的 ruby 和 rails 安装好了(我认为)。
C:\Users\benjaminw>ruby --version
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]
C:\Users\benjaminw>rails -v
Rails 3.2.13
我正在遵循 Ruby on Rails 书中的指导指南,但它有点过时了。下一步说下载 sqlite3 db 并将文件解压缩到以下文件夹 C:/Ruby200/bin
然后运行以下命令以确保 db 已正确安装
C:\Users\benjaminw>sqlite3 --version
3.7.16 2013-03-18 11:39:23 66d5f2b76750f3520eb7a495f6247206758f5b90
这就是问题出现的地方。当我输入下一个命令时,我得到一个错误,似乎正确设置环境很重要。有谁知道以下是什么意思以及如何解决?哦,我在我的 Windows 7 计算机 DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe 上安装了这个版本的 devkit。
C:\Users\benjaminw>gem install sqlite3-ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first.
*** 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=C:/Ruby200/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
Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1
.3.7 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/
gem_make.out