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'
Related
Ok I'm not a pro at creating gems, but I tried my best and created this gem https://rubygems.org/gems/webpack_native/versions/0.2.0
This gem has generators and if I use it from the local folder (meaning the gem folder is in my computer) it works fine, if I type rails g in terminal it shows me the generators including my gem's generators
But using it from rubygems always give me an error uninitialized constant WebpackNative:
/home/mody/.rvm/gems/ruby-2.7.0#myapp/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/active_support.rb:80:in `block in load_missing_constant': uninitialized constant WebpackNative (NameError)
any thoughts on this?
I'm not sure how this happen but I get it to work after I installed devise gem and run
rails g
the output of the available generators shows up including my gem, and the generator itself is working.
When I put require 'devise' in application.rb, I get the error cannot load such file -- devise but when I take it out, I get the error uninitialized constant Devise (NameError) I can't win.
It turns out that my gem file was just completely messed up. I needed to restart my project.
Error message of my server
A NameError occurred in..
uninitialized constant CarrierWave::Video app/uploaders/video_uploader.rb:7:in
<class:VideoUploader>'
video_uploader.rb:7 => include CarrierWave::Video
INFO :
In my local, it works(development & production mode)! But after deploy to server, occur that error.
But in my server rails c production,Input 'include CarrierWave::Video' then Rails Console print not 'NameError: uninitialized constant..' but 'Object'. This means 'include CarrierWave::Video' succeeded!!
Of course, these gem(gem 'carrierwave' , gem 'carrierwave-video') is in my Gemfile and Gemfile.lock and bundle install success.(when deploy) So in my_app/shared/bundle/ruby/2.0.0, GEM_HOME & GEM_PATH of my app, exist these gems
I think 'include' doesn't work. because Like this, i have been met this error at line 'include CarrierWave::RMagick' when using gem 'rmagick' to resize image file uploaded.
Of course, this is not solved yet..
Purely CarrierWave removed line 'include ~~' works well (ex : Image upload not resized..)
nginx + unicorn, linux ubuntu 12.04
Please help me.. T^T
i dont know why 'include CarrierWave::Video' not work in .rb file but work in rails console..
ADDED :
'require' about these gems not exist in my code(in application.rb.. etc..),
(require 'carrierwave/video'.)
If add "require 'carrierwave/video'" to application.rb below require 'rails/all',
occured my application is now worked all. If add to video_uploader.rb and I request page using video_uploader , then occur error cannot such file bulabula..
This error caused by your server didn't reload the module.
Just restart your rails server, and everything will go right.
Make sure you are loading CarrierWave after loading your ORM.
If you added gem 'carrierwave' do this rails generate uploader UPLOADER_NAME
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.
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.