我是Ruby的新手。我按照本教程安装:http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/
现在,当我这样做时: rails generate controller
rails 生成控制器主页索引
我收到此错误:
/home/hiccup-pro/Documents/qstack/config/environment.rb:8:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from /home/hiccup-pro/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/application.rb:103:in `require'
from /home/hiccup-pro/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
from /home/hiccup-pro/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/commands.rb:25:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
我修好了它。至少那个错误,但现在我有一个不同的错误,那就是:未初始化的常量 LoginController。我搜索了一下,发现我不应该在 environment.rb 中提及 config.*。无论如何,这是我的环境.rb
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Qack::Application.initialize!
config.action_controller.allow_forgery_protection = false
那么,为什么我会收到此uninitialized constant LoginController
错误?