我正在尝试在我的 Windows 7 操作系统上的 ruby 上运行 rails 服务器。我制作了一个新的 rails 应用程序,但是当我尝试运行服务器时,出现以下错误:
D:\projects\RubyOnRails>rails server
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in `block in replace_gem': Please
install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)
尝试安装activerecord-sqlite3-adapter
:
D:\projects\RubyOnRails>gem install activerecord-sqlite3-adapter
ERROR: Could not find a valid gem 'activerecord-sqlite3-adapter' (>= 0) in any repository
ERROR: Possible alternatives: activerecord-jdbcsqlite3-adapter, activerecord-sqlserver-adapter, activerecord-bq-adapter, activerecord-simpledb-adapter, activerecord-mysql2-adapter
在我尝试安装sqlite3
gem 后,我收到以下错误(我还必须安装 DevKit 才能继续执行此步骤):
D:\projects\RubyOnRails>gem install sqlite3
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
D:/Ruby200-x64/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.
在System32
文件夹中,我有sqlite3.dll
,sqlite3.exe
和sqlite
导出定义文件。
此外, sqlite3 似乎工作正常:
D:\projects\RubyOnRails>sqlite3
SQLite version 3.7.16.2 2013-04-12 11:52:43
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
另外,我的捆绑包是最新的:
D:\projects\RubyOnRails>bundle check
The Gemfile's dependencies are satisfied
但是在我的 gemfile 中没有关于 sqlite3 gem 版本的信息,当我放一个时,服务器无法启动:
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
请帮忙!