Getting an odd error. Just installed the Typus rails admin plugin, which is supposed to work in 2.3.2. However, after install it seems to mess with my user model. Not sure where to start here, any ideas?
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
/Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Typus::Authentication::ByPassword (NameError)
from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
from /Users/apple/Sites/app/app/models/user.rb:10
from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking'
from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:380:in `load_file'
from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:379:in `load_file'
from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:259:in `require_or_load'
from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:425:in `load_missing_constant'
... 35 levels...
from /Users/apple/.gem/ruby/1.8/gems/rails-2.3.2/lib/commands/server.rb:84
from /Library/Ruby/Site/1.8/rubygems
/custom_require.rb:31:in gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire'
from script/server:3
Are you using restful_authentication?
If so, there's a name conflict between the 'Authentication' module restful_authentication provides and the one included in Typus.
I renamed all the references to restful_authentication's modules from Authentication to RestfulAuthentication, and changed the module name in vendor/plugins/restful_authentication/lib/authentication.rb. Not sure if there's a better way to specify which module the model should use.
Alternatively, you can prefix the Restful Authentications with :: to clear up the discrepancy,
::Authentication instead of Authentication
Related
I am still having trouble with Ruby on Rails. I run rails s (this is for my openproject app) and I get this (before it was working). I also wanted to make a note I am now using Ruby 2.0 and I still get the same error.
require 'rails/all'... 0.850s
Bundler.require... 7.700s
/home/bistro/openproject/config/application.rb:89:in `<class:Application>': uninitialized constant I18n::JS (NameError)
from /home/bistro/openproject/config/application.rb:61:in `<module:OpenProject>'
from /home/bistro/openproject/config/application.rb:60:in `<top (required)>'
from /home/bistro/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.16/lib/rails/commands.rb:53:in `require'
from /home/bistro/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.16/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/bistro/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.16/lib/rails/commands.rb:50:in `tap'
from /home/bistro/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.16/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I'm working on a Rails Ember app and I had exactly the same problem, trying to internationalize the client-side using the i18n-js gem (https://github.com/fnando/i18n-js). To give more context, I am following the instructions in this article: http://eviltrout.com/2013/11/24/i18n-in-ember.html
In my case, Rails did not find I18n::JS because it is now called SimplesIdeias::I18n (you can see it by running rake middleware from the command line). Adding the line
config.middleware.use SimplesIdeias::I18n::Middleware
in the application.rb file solved the problem for me, hope it helps.
If you happen upon this now adays. your gemfile should say something like gem 'i18n-js', ">= 3.0.0.rc11". Otherwise you will end up using version 2.0
I have rails 2.0.1 and the latest version of pow.cx setup and I'm getting an error which I think is related to the config.ru file:
NameError: uninitialized constant ActionController::Dispatcher
~/repos/selfsale-001/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:263:in `load_missing_constant'
~/repos/selfsale-001/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:in `const_missing'
~/repos/selfsale-001/config.ru:3
~/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/builder.rb:4:in `instance_eval'
~/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/builder.rb:4:in `initialize'
~/repos/selfsale-001/config.ru:1:in `new'
~/repos/selfsale-001/config.ru:1
my config.ru is:
# Rails.root/config.ru
require "./config/environment"
run ActionController::Dispatcher.new
So ActionController isn't initialised, my question is what needs to be initialised for this setup? I have scoured Google and haven't found a config that works yet.
Any help would be greatly appreciated.
Hm.. my guess would be that you need to use at least Rails 2.3 to have a running Rack middleware, see
http://edgeguides.rubyonrails.org/2_3_release_notes.html
So, for Rails earlier than 2.3, your config.ru can not be used.
There is a Rails application I started a full year ago. It’s a Rails 2.3 app.
Now, someone else has made remote changes (it’s on Github, sorry, but it’s private). And I have done
sudo gem update
that is, updated all my gems, including Rails (to 3).
Realizing this, I have done
rake:freeze:edge RELEASE=2.3.8
or whatever to make this release use that version of rails, hoping this was the solution.
however, no such luck so far.
I get errors trying to start the server, AND trying to run script/console (though it’s more successful).
Note that this exact application works just fine on EngineYard.
Server:
$ script/server
=> Booting Mongrel
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 45, col 3: `' (ArgumentError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:902:in `database_configuration'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:437:in `initialize_database'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:141:in `process'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
from /Users/ajh/Sites/PROJECT_NAME/config/environment.rb:11
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/railties/lib/commands/server.rb:84
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3
Console:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in load':ArgumentError: syntax error on line 45, col 3:rai'
And when, in console, I try to use a defined model:
#mm = MyModel.find(:all)
NameError: uninitialized constant MyModel
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in load_missing_constant'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:inconst_missing'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
from (irb):1
I just had this error, and the problem turned out to be that I'd used a tab instead of a double-space in the database.yml file. Thought I'd mention it, in case others have the same trouble.
My database.yml had a stray end keyword. Cleaning up that file solved my problems. Thanks to Garrett for pointing me in the right direction!
I´d like to test my app with shoulda and machinist. I use the devise authentification gem.
I get following error:
$ ruby unit/page_test.rb
c:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be rem
oved on or after August 2010. Use #requirement
c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant Admins (N
ameError)
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
from c:/Users/Mattherick/Desktop/heimspiel/heimspiel_app/app/controllers/admins_controller.rb:1
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_or_load'
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_on'
... 12 levels...
from ./unit/../test_helper.rb:2
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from unit/page_test.rb:1
Somebody an idea what´s wrong? If I don´t use devise my tests are okay.
And my second question: Does somebdoy has a good tutorial for increasing different roles in the devise gem? If I generate my own views and add a few attributes to my devise-model, they won´t be save in the database. I read the docu at github, but don´t really checked it.
mattherick
I have tried to upgrade my rails in order to deploy a old RoR app into Heroku,
Unfortunately I'm getting some errors and I have no clue how to fix this. It seems that include Reloadable from my model isn't working anymore:
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant Artist::Reloadable (NameError)
from /disk1/home/slugs/123146_6bfd10b_0628/mnt/app/models/artist.rb:2
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_or_load'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_on'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_dependency'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:in `load_application_classes'
... 23 levels...
My previous install was using RAILS_GEM_VERSION = '1.1.2'.
Have you tried deleting the include Reloadable
Reloaded has been deprecated for a long time. Check this out: http://weblog.rubyonrails.org/2006/8/11/reloading-revamped
The functionality you're looking for may now be automatically built into rails.