0

我有一个rails 2.3.4 应用程序,我想用omniauth (0.1.5) 进行扩展。当我使用 rvm 安装omniauth gem 并在config.rb 文件中放置require 'omniauth' 时,我收到以下错误:

`gem_original_require': 没有要加载的文件——omniauth (MissingSourceFile)

教程建议使用将它放在 gemfile 中,但我使用的是 rails 2。

但是,当我“宝石列表”时,omniauth 可用。

这已经花了几天(头发拉),我不知道如何进行。

我是把需求放在正确的地方还是在其他地方我可以把它(除了明显的:-))?

任何想法都会很棒......

编辑1:我在你的environments.rb文件中尝试了config.gem“omniauth”并得到/home/mcaulejj/explorer/config/environment.rb:10: undefined local variable or method `config' for main:Object (NameError)

编辑 2:使用 RVM 我更新了所有宝石,但我仍然遇到同样的错误.....

在这一点上我很生气。

干杯

4

2 回答 2

1

试试config.gem "omniauth"你的environments.rb文件。

编辑

根据评论,

尝试:

require File.join(File.dirname(__FILE__), 'boot')
#insert the following here, in your config/environment.rb
if Gem::VERSION >= "1.3.6" 
    module Rails
        class GemDependency
            def requirement
                r = super
                (r == Gem::Requirement.default) ? nil : r
            end
        end
    end
end
于 2011-03-23T16:29:20.120 回答
0

添加require 'oa-oauth'你的 environment.rb 文件

于 2011-03-25T21:33:09.503 回答