简体   繁体   English

WEBrick Rails服务器无法正常工作

[英]WEBrick rails server is not working

My operating system is Windows 10 我的操作系统是Windows 10

Today I have installed Ruby (ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]) and rails gem (rails 4.2.4) 今天,我已经安装了Ruby(红宝石2.2.3p173(2015-08-18修订版51636)[x64-mingw32])和rails gem(rails 4.2.4)

I am following a proceedure set out in a series of tutorial videos about rails. 我正在按照一系列有关Rails的教程视频中介绍的过程进行操作。 I have the following version of myqsl 2 installed (and reinstalled in case it was a dirty install) mysql2-0.4.1-x64-mingw32 我安装了以下版本的myqsl 2(并且如果是恶意安装则重新安装)mysql2-0.4.1-x64-mingw32

This question pertains to a application called simple_cms created in the following fashion as per instructions on the tutorials 这个问题与一个名为simple_cms的应用程序有关,该应用程序按照教程中的说明以以下方式创建

rails new simple_cms -d mysql

I have: 我有:

  • run bundle install a few times 运行捆绑安装几次
  • used gem cleanup 二手宝石清理
  • run bundle exec rails server 运行bundle exec rails服务器
  • tried to rake db:create and bundle exec rake:db create each method as suggested here 尝试耙db:create并捆绑执行rake:db,按照此处的建议创建每个方法
  • reinstalled mysql2 a few times 重新安装mysql2几次

However upon input of 但是在输入

rails server

in the root of my project simple_cms. 在我的项目simple_cms的根目录中。 WEBrick fails to even kick off WEBrick甚至无法启动

By way of example in other similar questions here and here , both of the inquirers receive the following 作为此处此处其他类似问题的示例,两个查询者都收到以下内容

=> 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

etc ..etc....before the failure of WEBrick. 等.... WEBrick失败之前。 However I do not eve get this far as there is no mention of anything to do with WEBrick. 但是,由于没有提到与WEBrick有关的任何内容,因此我没有走得太远。 Below is the error message I receive after typing the rails server command: 以下是在输入rails server命令后收到的错误消息:

simple_cms>rails server
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-     4.2.4/lib/action_view/helpers.rb:40:in `<module:Helpers>': uninitialized constant ActionView::Helpers::ActiveModelHelper (NameError)
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_view/helpers.rb:4:in `<module:ActionView>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_view/helpers.rb:3:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_view/base.rb:5:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_view/base.rb:5:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:7:in `<class:Template>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:6:in `<module:WebConsole>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:1:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console.rb:12:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console.rb:12:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web-console.rb:1:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web-console.rb:1:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
    from C:/Users/Lizanne/Documents/Code/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

What can be done to rectify this situation as i am now going round in circle trying the same thing over and over again , and as Einstein rightly stated the definition of insanity is doing the same thing over and over again and expecting different results. 我现在要一遍又一遍地尝试相同的事情,并且正如爱因斯坦正确地指出,精神错乱的定义是一遍又一遍地做同一件事并且期望得到不同的结果时,可以做些什么来纠正这种情况。

i have the following gems installed 我安装了以下宝石

actionmailer (4.2.4) 
actionpack (4.2.4)
actionview (4.2.4)
activejob (4.2.4)
activemodel (4.2.4)
activerecord (4.2.4)
activesupport (4.2.4)
arel (6.0.3)
bigdecimal (1.2.7, 1.2.6)
binding_of_caller (0.7.2)
builder (3.2.2)
bundler (1.10.6)
byebug (6.0.2)
coffee-rails (4.1.0)
coffee-script (2.4.1)
coffee-script-source (1.9.1.1)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.6.0)
globalid (0.3.6)
i18n (0.7.0)
io-console (0.4.3)
jbuilder (2.3.2)
jquery-rails (4.0.5)
json (1.8.3, 1.8.1)
loofah (2.0.3)
mail (2.6.3)
mime-types (2.6.2)
mini_portile (0.6.2)
minitest (5.8.2)
multi_json (1.11.2)
mysql2 (0.4.1 x64-mingw32)
nokogiri (1.6.6.2 x64-mingw32)
power_assert (0.2.5)
psych (2.0.15, 2.0.8)
rack (1.6.4)
rack-test (0.6.3)
rails (4.2.4)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.7)
rails-html-sanitizer (1.0.2)
railties (4.2.4)
rake (10.4.2)
rdoc (4.2.0)
sass (3.4.19)
sass-rails (5.0.4)
sdoc (0.4.1)
sprockets (3.4.0)
sprockets-rails (2.3.3)
test-unit (3.1.5)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.1)
turbolinks (2.5.3)
tzinfo (1.2.2)
tzinfo-data (1.2015.7)
uglifier (2.7.2)
web-console (2.2.1)

Many thanks in advance 提前谢谢了

Check approved answer 检查批准的答案

It is a problem between versions railties and rails gems. 这是版本railtiesrails宝石之间的问题。 Yeah, is a answer complicated. 是的,答案很复杂。 For future developments try to use some versioning system for your projects ( Rbenv ) 为了将来的发展,请尝试为您的项目使用某些版本控制系统( Rbenv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM