In attempting to upgrade a Bort app with Rails 2.3.2, i’ve found two errors so far:
1. This OpenIdAuthentication error:
rake aborted! uninitialized constant Rails::Plugin::OpenIdAuthentication /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:105:in `const_missing' /home/chadd/foo/vendor/plugins/open_id_authentication/init.rb:16:in `evaluate_init_rb'
The solution is to comment out line 16 in vendor/plugins/open_id_authentication/init.rb when running rake db:migrate.
Updated: Better solution in the comments, thanks!
chadd@ubuntu:~/foo$ rake db:migrate --trace
(in /home/chadd/foo)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== BortMigration: migrating ==================================================
-- create_table(:sessions)
-> 0.0017s
-- add_index(:sessions, :session_id)
-> 0.0004s
-- add_index(:sessions, :updated_at)
-> 0.0003s
-- create_table(:open_id_authentication_associations, {:force=>true})
-> 0.0021s
-- create_table(:open_id_authentication_nonces, {:force=>true})
-> 0.0016s
-- create_table(:users)
-> 0.0027s
-- add_index(:users, :login, {:unique=>true})
-> 0.0006s
-- create_table(:passwords)
-> 0.0017s
-- create_table(:roles)
-> 0.0007s
-- create_table(:roles_users, {:id=>false})
-> 0.0007s
== BortMigration: migrated (0.5497s) =========================================
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
chadd@ubuntu:~/foo$
2. application.rb was renamed to application_controller.rb in Rails 2.3 and if you don’t rename it you get this error:
Loading development environment (Rails 2.3.2) /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant':NameError: uninitialized constant ApplicationController
I met the same problems.
For the #1, I found this alternative
https://rails.lighthouseapp.com/projects/8995/tickets/52-open-id-authentication-patch-uninitialized-constant-railspluginopenidauthentication
The solution is to stubbed out an empty “OpenIdAuthentication” module => module OpenIdAuthentication; end
so the OpenIdAuthentication module will be get loaded with the “ActionController::Base”.
Is this solution better??
thanks.
Yep, I like that solution better.
Looking at issue #2 and wondering if you had any success or if I need to downgrade my rails version to get things going
Thanks for this very informative article
I’ve run into the same and am very new to rails.
Where is init.rb located?
Thanks!
Thanks,
I used your patches for Bort and Rails 2.3.2 and it worked perfectly. Thank ou. You saved me a lot of time.
Kevin.
Just one other thing….
I think this is just for those using Passenger but tripped me up for a little while.
You may get an error regarding
relative_url_root
like this:
ActionView::TemplateError (undefined method `relative_url_root’ for #) on line #12 of app/views/layouts/application.html.erb:
This was solved by updating the asset_packager plugin.
./script/plugin install git://github.com/sbecker/asset_packager.git
Hope this saves someone else a little bit of time.
Kevin Monk.
Better yet… just run:
script/plugin install git://github.com/rails/open_id_authentication.git –force
This plugin has been updated already and it fixes this issue.
Ктрута пишешь
+1 поддерживаю
Молодец, хороший пост.
thanks, used your patch running with 2.3.5
автомобильные новости
По моему у Вас украли эту статью и поместили на другом сайте. Я её уже видела.
ruby script/plugin install git://github.com/senthilnambi/open-id.git
and then delete the old gem/plugin .
btw, the init.rb file they were talking about is in:
./vendor/plugins/open_id_authentication/init.rb
thanks for the article, it fixed my problem.
Thanks, your suggestion (+ stubbing OpenIdAuthentication) worked for me.
Someone should fork MattHall’s bort to fix this.