New Bort application breaks with Rails 2.3.2 17

Posted by chad on March 24, 2009

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
Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. volife Wed, 08 Apr 2009 23:38:16 UTC

    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.

  2. chad Thu, 09 Apr 2009 04:42:43 UTC

    Yep, I like that solution better.

  3. Charlie Mon, 13 Apr 2009 13:56:47 UTC

    Looking at issue #2 and wondering if you had any success or if I need to downgrade my rails version to get things going

  4. John Dyer Fri, 08 May 2009 00:04:56 UTC

    Thanks for this very informative article :)

  5. Matthew Sat, 09 May 2009 15:23:30 UTC

    I’ve run into the same and am very new to rails.

    Where is init.rb located?

    Thanks!

  6. Kevin Monk Tue, 09 Jun 2009 05:32:03 UTC

    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.

  7. Kevin Monk Tue, 09 Jun 2009 06:57:31 UTC

    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.

  8. Mike Ruby Fri, 31 Jul 2009 10:33:36 UTC

    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.

  9. Arkanzas Wed, 18 Nov 2009 04:27:57 UTC

    Ктрута пишешь :)

  10. Dimuggisgurgy Tue, 12 Jan 2010 14:13:17 UTC

    +1 поддерживаю

  11. Dimuggisgurgy Wed, 13 Jan 2010 02:03:23 UTC

    Молодец, хороший пост.

  12. kadoudal Wed, 20 Jan 2010 09:56:28 UTC

    thanks, used your patch running with 2.3.5

  13. Vladislav46 Thu, 18 Mar 2010 07:40:42 UTC
  14. Mihail1 Thu, 18 Mar 2010 13:08:44 UTC
  15. Piyush Gupta Fri, 23 Apr 2010 02:48:17 UTC

    ruby script/plugin install git://github.com/senthilnambi/open-id.git

    and then delete the old gem/plugin .

  16. phil Thu, 20 May 2010 01:07:50 UTC

    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.

  17. Keone Thu, 22 Jul 2010 10:33:02 UTC

    Thanks, your suggestion (+ stubbing OpenIdAuthentication) worked for me.

    Someone should fork MattHall’s bort to fix this.

Comments