我正在关注rails教程https://www.railstutorial.org/book/toy_app,并在运行此keyword = $(this).closest('form').find('.search').val();
这是错误:
$ rails generate scaffold User name:string email:string
我正在使用Windows 8.我正在使用Gitbash。我从安装rails网站安装了ruby和rails。当我输入ruby -v时,我得到c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x86-mingw32/l
ib/sqlite3.rb:6:in 'require': cannot load such file -- sqlite3/sqlite3_native (L
oadError)
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-
x86-mingw32/lib/sqlite3.rb:6:in 'rescue in <top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-
x86-mingw32/lib/sqlite3.rb:2:in '<top (required)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/
lib/bundler/runtime.rb:76:in 'require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/
lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/
lib/bundler/runtime.rb:72:in 'each'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/
lib/bundler/runtime.rb:72:in 'block in require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/
lib/bundler/runtime.rb:61:in 'each'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/
lib/bundler/runtime.rb:61:in 'require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/
lib/bundler.rb:133:in 'require'
from c:/sites/workspace/toy_app/config/application.rb:7:in '<top (requir
ed)>'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.0
/lib/rails/commands/commands_tasks.rb:141:in 'require'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.0
/lib/rails/commands/commands_tasks.rb:141:in 'require_application_and_environmen
t!'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.0
/lib/rails/commands/commands_tasks.rb:128:in 'generate_or_destroy'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.0
/lib/rails/commands/commands_tasks.rb:50:in 'generate'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.0
/lib/rails/commands/commands_tasks.rb:39:in 'run_command!'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.0
/lib/rails/commands.rb:17:in '<top (required)>'
from bin/rails:4:in 'require'
from bin/rails:4:in '<main>'
我尝试了here提供的解决方案,但它没有用。有什么想法吗?
答案 0 :(得分:2)
看起来this帖子解决了我的问题。我需要使用sqlite 1.3.10,其中包括对Ruby 2.1的支持。 Sqlite 1.3.9没有。
答案 1 :(得分:0)
如果您使用Windows的Rails安装程序,它将安装您需要的所有内容。
获取Rails安装程序答案 2 :(得分:0)
在您的项目终端上尝试:
捆绑更新sqlite3
捆绑更新nokogiri
我希望我帮助过你;)