开发者

bundler with rails 2.3.5 and plugins with 'require'

开发者 https://www.devze.com 2023-01-10 19:52 出处:网络
I\'m trying to use bundler with my Rails 2.3.5 app (built off of insoshi开发者_如何学Go) due to some complicated reasons.Basically, I need to deploy to a server that has Rails 2.3.8 and Rails 2.3.5 ap

I'm trying to use bundler with my Rails 2.3.5 app (built off of insoshi开发者_如何学Go) due to some complicated reasons. Basically, I need to deploy to a server that has Rails 2.3.8 and Rails 2.3.5 apps, and they don't play nice with each other because 2.3.8 requires rack 1.1.0, while 2.3.5 requires rack 1.0.1 and blows up if rack 1.1.0 is even installed. At least, that's how I'm interpreting https://rails.lighthouseapp.com/projects/8994/tickets/3685-actionpack-235-gem-declares-incompatibility-with-rack-110

Anyway, I installed bundler but I get an error in some of the plugins that came packaged with the app. Here:

pdt-eleven:dreamcar glurban$ ruby script/server
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require': no such file to load -- openid (MissingSourceFile)
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    from /Users/glurban/code/dreamcar/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb:2
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    from /Users/glurban/code/dreamcar/vendor/plugins/open_id_authentication/init.rb:5:in `evaluate_init_rb'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:158:in `evaluate_init_rb'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:154:in `evaluate_init_rb'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:48:in `load'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:38:in `load_plugins'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `each'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `load_plugins'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:369:in `load_plugins'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:165:in `process'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
    from /Users/glurban/code/dreamcar/config/environment.rb:14
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /Users/glurban/code/dreamcar/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    from /Users/glurban/code/dreamcar/config.ru:4
    from /Users/glurban/.rvm/gems/ruby-1.8.7-p299/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
    from /Users/glurban/.rvm/gems/ruby-1.8.7-p299/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
    from /Users/glurban/code/dreamcar/config.ru:1:in `new'
    from /Users/glurban/code/dreamcar/config.ru:1
    from script/server:3:in `eval'
    from /Users/glurban/code/dreamcar/vendor/rails/railties/lib/commands/server.rb:78
    from script/server:3:in `require'
    from script/server:3

Here's the offending line in open_id_authentication.rb:

require 'uri'
require 'openid'
require 'rack/openid'

So, am I supposed to add all of these gems to my Gemfile? When I wasn't using bundler they loaded automatically, I think, but now no?

Thanks.


Fixed it a while ago but realized I never posted the solution. As expected, adding this to the gemfile worked:

gem 'rack/openid', '>=1.0.1'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号