启动rails server
命令后,Ruby终端没有启动服务器并写下以下内容:
C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from C:/Sites/testing/config/application.rb:7:in `<top (required)>'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
在寻找类似问题的答案时,我还没有找到任何可行的解决方案。我可以这样说:
gem cleanup
bundle install
bundle exec rails server
启动服务器。所有这些都没有帮助,所以我非常感谢能够使用我的案例解决方案!
P.S。我正在研究:Windows 8.1(64位),Ruby 2.3.0,Rails 5.0.0
答案 0 :(得分:1)
找到你的sqlite3 gemspec文件。一个例子是
`/usr/local/share`/gem/specifications/sqlite3-1.3.7.gemspec`
Windows:C:\Ruby21\lib\ruby\gems\2.1.0\specifications.
您应该根据您的Rubygem路径和sqlite3版本进行调整。编辑上面的文件并查找以下行
s.require_paths=["lib"]
将其更改为
s.require_paths= ["lib/sqlite3_native"]
希望有所帮助!!!