2012-04-11 99 views
0

我有安装好的宝石,并且在我的ApplicationController中设置为使用版本3的API,但它抛出了上述错误。这里是我的application_controller.rb未初始化的常量ApplicationController :: Bitly

class ApplicationController < ActionController::Base 
    protect_from_forgery 
    Bitly.use_api_version_3 
    before_filter { @cart = find_or_create_cart_from_session } 
    before_filter { @bitly = Bitly.new('myusername', 'XXXXXX_API_KEY_XXXXX') } 

回答

0

你说你已经安装了宝石,但你把它列入你的Gemfile的开始?如果Gem不在您的Gemfile中,您的应用程序将无法找到它,这将导致未初始化的常量错误。

+0

是的,它在Gemfile中,我运行'bundle install' – Chris 2012-04-11 17:58:31

相关问题