【问题标题】:undefined local variable or method `config' for #<Bundler::Dsl:0x7fe2598d56d8>#<Bundler::Dsl:0x7fe2598d56d8> 的未定义局部变量或方法“config”
【发布时间】:2012-11-02 19:11:19
【问题描述】:

我正在学习以下教程:

http://railscasts.com/episodes/188-declarative-authorization?view=comments

还尝试了在 Git 上关注 gem 的文档:

https://github.com/stffn/declarative_authorization

但是两次的结果都是一样的:

mark@ubuntu:~/RoR Projects/blog$ sudo rake gems:install
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
rake aborted!
undefined local variable or method `config' for #Bundler::Dsl:0x7fe2598d56d8>

我已严格按照每个教程进行操作,但始终得到相同的输出,所以我猜这是我的系统问题?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3


    【解决方案1】:

    看起来您正在使用 Rails 的旧方式(在 bundler 之前)包含 gem,但使用的是 bundler 并且它是 Gemfile

    gem "declarative_authorization" 添加到您的Gemfile,它应该可以按预期工作。

    【讨论】:

    • ps:你可能还想在 github 上开一张票,让作者知道他们的文档已经过时,或者至少不够清晰
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-26
    相关资源
    最近更新 更多