i try to deploy a rails 3.1.3 app to heroku but keep getting the following error when browsing the pages:
ActionView::Template::Error (undefined method `asset_path' for #<#<Class:0x00000002ecd630>:0x00000002e52480>):
i use the "cedar" stack as recommended by heroku. any idea why i get this issue? do i have to make some more configuration?
thanks in advance!
EDIT: works again. i forgot to add "require 'sprockets/railtie'" in the application.rb...
You forgot to add "require 'sprockets/railtie'" in the application.rb
Related
I am running a Rails app uploading images with a Cloudinary/Attachinary configuration.Locally, everything is fine, my app run and I can upload pictures to Cloudinary. I can push on Heroku, migrations are OK, config vars too but the app crashes with that error:
<class:CorsController>': undefined method `respond_to' for Attachinary::CorsController:Class (NoMethodError)
Some help would be really appreciated.
Thanks,
Kevin
Just found this: How to include respond_to when you don't inherit from ApplicationController in Rails 4? and it solves my problem.
#Gemfile
gem 'responders'
then
$ bundle install
$ rails g responders:install
I try to deploy a Rails app with capistrano
I use foundation-rails, and when I deploy, i've got this error :
Sass::SyntaxError: Undefined variable: "$oil".
Even if I had manually $oil in my sass file, it doesn't solve the problem.
I fixed the problem by downgrading foundation-rails gem !
Thanks for your help
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'm using compass-rails gem in my Rails app. I'm using rails 3.2 and trying to deploy on Heroku cedar stack.
Assets precompilation seemed to pass without any problems.
I keep getting the following error (in the log) when trying to access the site:
ActionView::Template::Error (File to import not found or unreadable: compass.
What am I doing wrong?
I found the problem. Apparently, Heroku must have the following configuration set:
config.assets.initialize_on_precompile = false
I added it and everything works fine now.
When I run the rails application, I get the following error:
undefined local variable or method "config" for main:Object
How can I resolve it?
My guess is that you found some code examples from an older version of rails, which called for you to place a config.gem * in your environment.rb file. To fix this add the gem requirement to your gemfile.
in your enviroment.rb file, cut any line starting with config and paste into your production.rb/development.rb/test.rb instead.
This is what worked for me when I had a similar problem.
I had this problem when an application had been upgraded from Rails 2 to Rails 3. It worked in development but I got this error when running in production mode for the first time because config/environments/production.rb contained Rails 2-style lines such as:
config.cache_classes = true
..which needed converting to Rails 3-style:
<<NameOfYourApp>>::Application.configure do
config.cache_classes = true
end