创立了一个类似员额: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