Rails生成错误

时间:2012-09-22 14:57:49

标签: ruby-on-rails ruby model rails-generate

每次我尝试使用rails generate时,都会收到以下错误消息。不确定我做错了什么:

rails generate controller Say hello goodbye
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:251:in `block in default_middleware_stack': uniniti
alized constant Rails::Rack::Logger (NameError)
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:232:in `tap'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:232:in `default_middleware_stack'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:469:in `app'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application/finisher.rb:31:in `block in <module:Finis
her>'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from E:/AptanaWorkspace/depot/config/environment.rb:5:in `<top (required)>'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:103:in `require'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:103:in `require_environment!'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:25:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

ruby​​版本1.9.3 rails版本3.2.6

1 个答案:

答案 0 :(得分:0)

从您的日志中

uninitialized constant Rails::Rack::Logger

这意味着有些东西正在寻找Rails :: Rack:Logger但却无法找到它。执行以下操作以查看是否已安装Rack。

bundle show rack
/home/nrowegt/.rvm/gems/ruby-2.2.2/gems/rack-1.6.1

如果没有显示,请重新运行&#34;捆绑安装&#34;或者&#34; gem install rack&#34;