0

当我将 Rails 应用程序(使用 restful_authentication)部署到 Heroku 时,出现以下错误:

/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant User::Authentication (NameError)
 from /disk1/home/slugs/216145_64fa92e_1859/mnt/app/models/user.rb:4
 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
 from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
 from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_or_load'
 from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_on'
 from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_dependency'
 from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:in `load_application_classes'
  ... 23 levels...
 from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
 from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
 from /home/heroku_rack/heroku.ru:1:in `new'
 from /home/heroku_rack/heroku.ru:1

我怎样才能让它工作?

4

3 回答 3

0

您是否在 Heroku 上安装了 gem“restful_authentication”?错误消息表明它不存在。

于 2010-06-19T22:10:14.553 回答
0

我在这里摸索,特别是因为你没有提出完整的追溯。

但是,可能与 cache_template_extensions 有关。

http://www.mail-archive.com/heroku@googlegroups.com/msg02172.html 谈到它,关于你的问题,http://forums.pragprog.com/forums/66/topics/2484提到这是升级到 2.3.2 时的一个问题。

底线:在您的代码(development.rb 或附近的某处)中找到引用 cache_template_extensions 的那一行,然后将其删除。

祝你好运。

于 2010-06-24T13:42:16.627 回答
0

谢谢大家!看起来这是 Heroku 的问题。我联系了他们的支持,他们不得不做点什么。

现在可以了。:)

于 2010-06-24T19:12:37.273 回答