English 中文(简体)
姓名:未开始 调度员:调度员
原标题:NameError: uninitialized constant ActionController::Dispatcher

创立了一个类似员额:here,但我正在经营一个Mac,因此第一种解决办法并不适用于我,第二只为我工作。

采用1.9.3p0 (2011-10-30 修订33570)[x86_64-darwin11.2.0]

我认为,这个问题很棘手,但我不知道如何解决这一问题。

$ rails new dispatch_me
$ rails generate controller demo index 
$ rails console
Loading development environment (Rails 3.2.0.rc2)
1.9.3-p0 :001 > env = {}
 => {} 
1.9.3-p0 :002 > env[ REQUEST_METHOD ] =  GET 
 => "GET" 
1.9.3-p0 :003 > env[ PATH_INFO ] =  /demo/index 
 => "/demo/index" 
1.9.3-p0 :004 > env[ rack.input ] = StringIO.new
 => #<StringIO:0x007f946db0ece0> 
1.9.3-p0 :005 > ActionController::Dispatcher.new.call(env).last.body
NameError: uninitialized constant ActionController::Dispatcher
from (irb):5
from /Users/rudolph9/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc2/lib/rails/commands/console.rb:47:in `start 
from /Users/rudolph9/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc2/lib/rails/commands/console.rb:8:in `start 
from /Users/rudolph9/.rvm/gems/ruby-1.9.3-p0/gems/railties-    3.2.0.rc2/lib/rails/commands.rb:41:in `<top (required)> 
from script/rails:6:in `require 
from script/rails:6:in `<main> 
1.9.3-p0 :006 > 

下面是。 铁路3 铁路:

Again, 我认为,这个问题很棘手,但我不知道如何解决这一问题。?

UPDATE: Maybe it doesn t have something to do with rvm, running native Ruby 1.8.7 and Rails 3.1.3 I run into the same issue:

>> ActionController::Dispatcher.new.call(env).last.body
NameError: uninitialized constant ActionController::Dispatcher
    from (irb):6
最佳回答

审视一下。 鲁,我的情况是:

> cat config.ru 
# This file is used by Rack-based servers to start the application.

require ::File.expand_path( ../config/environment ,  __FILE__)
run Wagn::Application

该档案与Main:Application为3.0,改用当地名称。

我在我的发言中使用了这一说法(Rack:试验):

def app
  Wagn::Application
end

注:没有新字,因为这一类是申请,而不是中等软件。

问题回答

参看<条码>行动主计长:调度员。 在你重新使用的铁路版本中,只有一点。 如果你读了一本书,通常最好贴上铁路版本,该书就是为之写的。





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签