I installed exception_notifier gem following this http://railscasts.com/episodes/104-exception-notifications-revised. But when running rails s, I got this
/home/ruby-2.0.0-p195/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:43:in `build': undefined method `new' for ExceptionNotifier:Module (NoMethodError)
So I tried to Google this problem, and I found that I could use in my production.rb file this config.middleware.use ExceptionNotifier::Rack... insted of this config.middleware.use ExceptionNotifier...
But then I got this message:
uninitialized constant ExceptionNotifier::Rack (NameError)
How should I handle this gem installation ?
If you follow the link https://github.com/smartinez87/exception_notification indicated by #pdobb, you 'll find you have to use
ExceptionNotification::Rack
instead of
ExceptionNotifier::Rack
It's ExceptionNotification::Rack. ExceptionNotifier was for the pre-4.0 versions. See the Getting Started info here: https://github.com/smartinez87/exception_notification for the specifics.
Related
I've deployed my app to Heroku and am getting the the following error:
v2014-08-29T01:59:06.582118+00:00 app[web.1]: NameError (uninitialized constant HomesController::Indirizzo):
I am using the Indirizzo gem and it's showing as being install on Heroku, but I am still getting that error. I have tried
gem 'Indirizzo', require 'Indirizzo'
in my gem file as one post suggested but that didnt work either.
Make a file (config/initializers/require_indirizzo.rb) to require it, like so:
require 'Indirizzo'
If this does not work, you may try the solution posted by gotva and use this instead:
require 'indirizzo/address'
Error:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/devise-1.0.11/lib/devise.rb:89:in '': undefined method 'weeks' for 2:Fixnum (NoMethodError)
That error is thrown whenever I try to run 'rails g devise:install' in a rails project I've been working on.
Any ideas?
P.S. requiring gem 'devise' in Gemfile and running bundle install to get the devise gem
This issue was already dealt with here. Try updating to a later devise version to fix.
I'm learning Rails with the awesome Ruby on Rails Tutorial by Michael Hartl. I'm on section 3.2.2 (Test Driven Development) in which I need to run the following command to run the rspec tests for my Rails project:
bundle exec rspec spec/
But it doesn't work. Instead I get this error:
/Users/mh/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/
activerecord-3.1.3/lib/active_record/base.rb:1088:in `method_missing':
undefined method `mass_assignment_sanitizer=' for
ActiveRecord::Base:Class (NoMethodError)
I've tried reinstalling rspec and changing my Gemfile, but nothing appeases the undefined method error!
Did you downgrade from Rails 3.2 RC1? Comment out the following two lines from your development.rb:
config.active_record.mass_assignment_sanitizer = :strict
config.active_record.auto_explain_threshold_in_seconds = 0.5
While m818's answer will solve the problem, you might still get errors if you are tyring to use deprecated methods elsewhere in your code.
I had the same problem, commenting out those lines got rid of some errors, but not all of them, anywhere I was using attr_accessible gave me the same error.
It turned out to be the `active_record' gem that was updated to 4.0 when I didn't want it to. Since I'm using a Padrino app, I had to do this in the Gemfile:
gem 'activerecord', '= 3.2.12', :require => "active_record"
That solved all issues and I didn't have to comment out the lines in database.rb.
I am trying to setup gitorious yousource branch, I've followed partly this article: http://www.lacerta.be/d7/content/gitorious-ubuntu-natty
Everything was installed but I get this error:
Error message:
uninitialized constant Rails::Plugin::OpenID
Exception class:
NameError
Application root:
/var/www/gitorious
My Gemfile has gem "ruby-openid", :require => 'openid' but doesn't work anyway.
Anyone know how could i fix it?
Maybe you are not loading "ruby-openid" before the OpenID is called in Rails::Plugin namespace.
I'm trying to get Devise up and running. I'm using devise 1.0.10 and rails 2.3.8, on an otherwise pretty clean hostingrails install.
When I run ruby script/generate devise_install
I get the following error message. Has anyone seen this before. Any ideas how to proceed with the install? I searched around and hit a wall.
Thanks, Tim
ruby script/generate devise_install
/home/p7017r10/appname/config/environment.rb:4: warning: already initialized constant RAILS_ENV
/usr/local/rvm/gems/ruby-1.8.6-p369/gems/activerecord-2.3.8/lib/active_record/base.rb:1994:in method_missing': undefined local variable or methodauthentication_keys' for # (NameError)
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:18:in included'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:16:inclass_eval'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:16:in included'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:66:ininclude'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:66:in devise'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:65:ineach'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:65:in devise'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/orm/active_record.rb:24:inincluded_modules_hook'
... 37 levels...
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/rails-2.3.8/lib/commands/generate.rb:1
from /usr/local/rvm/rubies/ruby-1.8.6-p369/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.6-p369/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from script/generate:3
check the devise group on google groups
http://groups.google.com/group/plataformatec-devise
that's the better forum to ask this question
I guess you should look into initializers/devise.rb. There are some instructions on setting those keys. Plus, please refer to http://asciicasts.com/episodes/210-customizing-devise, http://blog.plataformatec.com.br/tag/subdomain/.
I didn't use devise with RoR 2.3.x, only with 3.0.x. That could be the difference.
Hope that helps. Let us know :)