【问题标题】:Rails 2.0.1, Pow.cx - config.ru errorRails 2.0.1,Pow.cx - config.ru 错误
【发布时间】:2013-02-13 17:21:48
【问题描述】:

我有 rails 2.0.1 和最新版本的 pow.cx 设置,我收到一个错误,我认为这与 config.ru 文件有关:

  NameError: uninitialized constant ActionController::Dispatcher
  ~/repos/selfsale-001/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:263:in `load_missing_constant'
  ~/repos/selfsale-001/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:in `const_missing'
  ~/repos/selfsale-001/config.ru:3
  ~/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/builder.rb:4:in `instance_eval'
  ~/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/builder.rb:4:in `initialize'
  ~/repos/selfsale-001/config.ru:1:in `new'
  ~/repos/selfsale-001/config.ru:1

我的config.ru 是:

# Rails.root/config.ru
require "./config/environment"
run ActionController::Dispatcher.new

所以 ActionController 没有初始化,我的问题是这个设置需要初始化什么?我已经搜索了谷歌,但还没有找到可行的配置。

任何帮助将不胜感激。

【问题讨论】:

    标签: ruby-on-rails ruby rack ruby-on-rails-2 rack-pow


    【解决方案1】:

    嗯.. 我猜你至少需要使用 Rails 2.3 才能运行 Rack 中间件,请参阅

    http://edgeguides.rubyonrails.org/2_3_release_notes.html

    因此,对于 2.3 之前的 Rails,您的 config.ru 无法使用。

    【讨论】:

    • 感谢您提供的信息poseid,如果我不使用config.ru pow.cx 需要一个。这是否意味着我不能使用 pow.cx?
    • 是的,据我所知 pow 是用于 Rack 应用程序的基于 NodeJS 的服务器。由于您仅使用 Rails 2.0.x ,因此您没有使用 Rack 兼容堆栈。
    猜你喜欢
    • 1970-01-01
    • 2015-05-16
    • 2018-07-21
    • 2013-10-17
    • 2013-02-06
    • 2013-07-23
    • 2018-10-03
    • 1970-01-01
    • 2014-07-09
    相关资源
    最近更新 更多