无法在Windows 8上启动rails服务器

时间:2014-10-01 05:24:22

标签: ruby-on-rails ruby ruby-on-rails-4 webserver

我正在关注ruby教程并在运行' rails s'我收到这个错误。

此前工作正常,但现在我无法启动rails服务器。好像我在rails中改变了一些东西。

  

启动WEBrick   Rails 4.1.5应用程序在开发中开始   运行rails server -h以获取更多启动选项   注意:服务器正在侦听所有接口(0.0.0.0)。考虑使用127.0   0.1( - 绑定选项)   Ctrl-C关闭服务器   黄希庭   :/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-4.1.5/lib/act   ve_support / dependencies.rb:247:在require': cannot load such file -- syslogger (LoadError) from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport- .1.5/lib/active_support/dependencies.rb:247:in块中的require&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-   .1.5 / lib / active_support / dependencies.rb:232:in load_dependency' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport- .1.5/lib/active_support/dependencies.rb:247:in要求&#39;          来自c:/Sites/omrails/config/environment.rb:8:in <top (required)>' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport- .1.5/lib/active_support/dependencies.rb:247:in要求&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-   .1.5 / lib / active_support / dependencies.rb:247:在block in require' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport- .1.5/lib/active_support/dependencies.rb:232:in load_dependency&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-   .1.5 / lib / active_support / dependencies.rb:247:在require' from c:/Sites/omrails/config.ru:3:in块中&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib   rack / builder.rb:55:in instance_eval' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib rack/builder.rb:55:in初始化&#39;          来自c:/Sites/omrails/config.ru:在new' from c:/Sites/omrails/config.ru:in&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib   rack / builder.rb:49:in eval' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib rack/builder.rb:49:in new_from_string&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib   rack / builder.rb:40:in parse_file' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib rack/server.rb:277:in build_app_and_options_from_config&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib   rack / server.rb:199:在app' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.5 lib/rails/commands/server.rb:50:in app&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib   rack / server.rb:314:wrapped_app' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.5 lib/rails/commands/server.rb:130:in log_to_stdout&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.5   lib / rails / commands / server.rb:67:在服务器的start' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.5 lib/rails/commands/commands_tasks.rb:81:in块中&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.5   lib / rails / commands / commands_tasks.rb:76:在tap' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.5 lib/rails/commands/commands_tasks.rb:76:in服务器&#39;          来自c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.5   lib / rails / commands / commands_tasks.rb:40:in run_command!' from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.5 lib/rails/commands.rb:17:in&#39;          来自bin / rails:4:require' from bin/rails:4:in&#39;

****编辑 我尝试重新安装rails,现在我在启动rails server ****时出现此错误

  

C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.1.5/lib/active_support/de   pendencies.rb:247:在require': cannot load such file -- sqlite3/sqlite3_native (LoadError) from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.1.5/lib/acti ve_support/dependencies.rb:247:in块中的require&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.1.5/lib/acti   ve_support / dependencies.rb:232:in load_dependency' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.1.5/lib/acti ve_support/dependencies.rb:247:in要求&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x64-mingw32/li   b / sqlite3.rb:6:rescue in <top (required)>' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x64-mingw32/li b/sqlite3.rb:2:in&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/ru   ntime.rb:76:在require' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/ru ntime.rb:76:in块(2级)中的require&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/ru   ntime.rb:72:在each' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/ru ntime.rb:72:in块中的require&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/ru   ntime.rb:61:each' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/ru ntime.rb:61:in要求&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler.rb   :133:require' from C:/Sites/omrails/config/application.rb:7:in&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/com   mands / commands_tasks.rb:79:在服务器的require' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/com mands/commands_tasks.rb:79:in块中&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/com   mands / commands_tasks.rb:76:在tap' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/com mands/commands_tasks.rb:76:in服务器&#39;           来自C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/com   mands / commands_tasks.rb:40:in run_command!' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/com mands.rb:17:in&#39;           来自bin / rails:4:require' from bin/rails:4:in&#39;

1 个答案:

答案 0 :(得分:1)

问题出在哪里?

  

您在 Windows 上使用 sqlite3 数据库 Rails

我的Windows 10上也出现了类似的错误警告!

错误位于何处?

  

错误位于 gemspec 文件夹中!

Windows 8 上找到 gemspec 文件夹: C:\Ruby21\lib\ruby\gems\2.1.0\specifications

如果您正在使用RailsInstaller,请访问:C:\RailsInstaller\Ruby2.1.0\lib\ruby\gems\2.1.0\specifications

手动修复

  

您应该根据您的Rubygem路径和sqlite3版本进行调整。

编辑

的文件
  • sqlite3的 -4.1.5.gemspec
  • 的ActiveSupport -4.1.5.gemspec
  • -4.1.5.gemspec
  • railties -4.1.5.gemspec

并查找以下行:

s.require_paths=["lib"]

将其更改为:

s.require_paths= ["lib/sqlite3_native"]

有用的链接

  

您的问题类似于cannot load such file -- sqlite3/sqlite3_native (LoadError) on ruby on rails