我是Ruby的新手。我按照這個教程安裝:http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/
Ruby中未初始化的常量LoginController。
現在,當我這樣做:導軌產生控制器
軌生成控制器入戶指標
我得到這個錯誤:
/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>'
我固定它。至少該錯誤,但現在我有一個不同的bug,那就是:未初始化的常量LoginController。我搜索了一下,發現我不應該在environment.rb中提及config。*。 反正 這是我的environment.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
?
你能發佈你的environment.rb文件嗎? –
你還使用哪個版本的Rails? –
我在集成facebook應用程序時也遇到過這種問題,但無法修復它。然後我最終使用'facebooker2'gem ... –