Jruy/Rails 3 中的 NameError 未初始化常量

发布于 2024-12-08 12:40:54 字数 1228 浏览 0 评论 0原文

我正在将一个项目从 Rails 2.6 升级到 Rails 3.1 和 Jruby 1.6.4 我遵循 Jeremy 的 Rails 手册。

现在我在启动服务器时遇到一些错误。

 NameError in Adm::AuthController#login

 uninitialized constant Sentry::Dispatcher::Dispatcher

错误日志

 Started GET "/admin/login/en/sentry" for 127.0.0.1 at Wed Oct 05 16:59:00 -0400
 2011
 Processing by Adm::AuthController#login as HTML
 Parameters: {"brand"=>"sentry", "language"=>"en"}
 Completed 500 Internal Server Error in 9ms

 NameError (uninitialized constant Sentry::Dispatcher::Dispatcher):
 lib/sentry/dispatcher/application_dispatcher.rb:11:in `initialize'
 app/controllers/application_controller.rb:90:in `before_interceptors'

  Rendered C:/Users/matin/.pik/rubies/JRuby-164/lib/ruby/gems/1.8/gems/actionpack-
  3.1.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (5.0ms)
  Rendered C:/Users/matin/.pik/rubies/JRuby-164/lib/ruby/gems/1.8/gems/actionpack-
   3.1.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
(5.0ms)
Rendered C:/Users/matin/.pik/rubies/JRuby-164/lib/ruby/gems/1.8/gems/actionpack-
3.1.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within re
scues/layout (30.0ms)

I'm upgrading a project to Rails 3.1 and Jruby 1.6.4 from rails 2.6 I followed the Rails Handbook by Jeremy.

Now I'm getting some errors while booting the server.

 NameError in Adm::AuthController#login

 uninitialized constant Sentry::Dispatcher::Dispatcher

The error log

 Started GET "/admin/login/en/sentry" for 127.0.0.1 at Wed Oct 05 16:59:00 -0400
 2011
 Processing by Adm::AuthController#login as HTML
 Parameters: {"brand"=>"sentry", "language"=>"en"}
 Completed 500 Internal Server Error in 9ms

 NameError (uninitialized constant Sentry::Dispatcher::Dispatcher):
 lib/sentry/dispatcher/application_dispatcher.rb:11:in `initialize'
 app/controllers/application_controller.rb:90:in `before_interceptors'

  Rendered C:/Users/matin/.pik/rubies/JRuby-164/lib/ruby/gems/1.8/gems/actionpack-
  3.1.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (5.0ms)
  Rendered C:/Users/matin/.pik/rubies/JRuby-164/lib/ruby/gems/1.8/gems/actionpack-
   3.1.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
(5.0ms)
Rendered C:/Users/matin/.pik/rubies/JRuby-164/lib/ruby/gems/1.8/gems/actionpack-
3.1.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within re
scues/layout (30.0ms)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

那支青花 2024-12-15 12:40:54

这对我有用..

在升级时,您还需要包含该类,例如(在本例中)

  include 'sentry/dispatcher/dispatcher'

This works for me..

while upgrading you need to include the class as well, like(in this case)

  include 'sentry/dispatcher/dispatcher'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文