7

I install plugin open_id_authentication and have this error:

/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require': no such file to load -- rack/openid (LoadError)

when I try to start rails server Actually, rack-openid installed in my system and i can load it from irb:

irb(main):001:0> require 'rack/openid'
=> true

I tried to add hack to Gemfile as I did with ruby-openid, but it did't help:

gem "ruby-openid", :require => "openid"
gem "rack-openid", :require => "rack/openid"

I also have tried

gem "ruby-openid", :require => "rack/openid"

but:

/usr/lib/ruby/gems/1.9.1/gems/bundler-0.9.7/lib/bundler/runtime.rb:38:in `require': no such file to load -- rack/openid (LoadError)

In rails 2.3.5 app there isn't this problem and I can't understand why it happens in Rails 3.

Pavel Manylov
  • 649
  • 1
  • 6
  • 17

3 Answers3

7

The problem is this code at the top of the plugin's init.rb

if Rails.version < '3'
  config.gem 'rack-openid', :lib => 'rack/openid', :version => '>=0.2.1'
end

Bundler doesn't seem to pick up on the gem requirement so you are missing the rack-openid gem.

The solution is to add the following to your Gemfile in place of ruby-openid. (rack-openid depends on ruby-openid but gems is aware of this and will install it as needed)

gem 'rack-openid', '>=0.2.1', :require => 'rack/openid'

Don't forget to run bundle install after updating your Gemfile.

epochwolf
  • 12,340
  • 15
  • 59
  • 70
1

I understand your problem since ruby openID can be very erratic, for small reasons.. I have it installed at work, but can't get it right at home! I will give my working recipe:

I have the Plugins (ONLY)
authlogic_openid from: http://github.com/binarylogic/authlogic_openid
open-id from: http://github.com/senthilnambi/open-id

The Gems:
authlogic (2.1.3)
authlogic-oid (1.0.4)
openid (0.0.1)
rack (1.0.1)
rack-openid (1.0.1)
ruby-openid (2.1.7)

At environment (ONLY):
config.gem "authlogic"

GL!

Fabiano Soriani
  • 8,182
  • 9
  • 43
  • 59
  • Yes it works as Fabiano PS says! Please follow this setup. If not you won't be able to run rake open_id_authentication:db:create!! Thanks a ton Fabiano. Solved my problem. – Shripad Krishna Apr 18 '10 at 13:02
0
gem "rack-openid", :require => "rack/openid"
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364