【问题标题】:restful_authentication deployment to Heroku - Name Error将 restful_authentication 部署到 Heroku - 名称错误
【发布时间】:2011-03-05 20:16:35
【问题描述】:

当我将我的 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

我怎样才能让它工作?

【问题讨论】:

  • 您可能会考虑的一个想法是在您的应用程序中设置捆绑程序,然后使用bundle package 命令将所有宝石保存到您的应用程序中。然后,当您部署时,所有 gem 将与您的应用程序一起部署。可以在此处找到有关使用 rails 2.3.5 设置捆绑程序的详细信息:blog.admoolabs.com/using-bundler-0-9-4-with-rails-2-3-5

标签: ruby-on-rails heroku restful-authentication


【解决方案1】:

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

【讨论】:

  • 好的,我已经做到了。现在,无论我做什么,我都会明白这一点。我已指定在我的 gem 清单中更正 rails gem,并在 environment.rb 中获得了正确的版本。 Rails 找不到预期的版本。检查以确保您在 Gemfile 或 .gems 中指定了正确的 Rails 版本。对于 Rails 2.3.5 或更早版本,您可能会受到 Rails 依赖问题的影响。
【解决方案2】:

我在这里摸索,尤其是因为您没有提供完整的追溯。

但是,可能与 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 的那一行,并将其删除。

祝你好运。

【讨论】:

    【解决方案3】:

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

    现在可以了。 :)

    【讨论】:

      猜你喜欢
      • 2016-06-27
      • 2017-12-14
      • 2012-05-22
      • 2014-05-18
      • 2016-08-26
      • 1970-01-01
      • 1970-01-01
      • 2011-03-25
      相关资源
      最近更新 更多