Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot precompile assets #6

Closed
algritz opened this issue Oct 30, 2012 · 3 comments
Closed

Cannot precompile assets #6

algritz opened this issue Oct 30, 2012 · 3 comments

Comments

@algritz
Copy link

algritz commented Oct 30, 2012

$ rake assets:precompile RAILS_ENV=production
c:/Ruby193/bin/ruby.exe c:/Ruby193/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=ass
rake aborted!
undefined method `rate_path' for #Module:0x39accc8
(in C:/MYAPP/app/assets/javascripts/letsrate.js.erb)

which is this line =>
$.post('<%= Rails.application.class.routes.url_helpers.rate_path %>',

Rails 3.2.6
Ruby 1.9.3
Windows 7
letsrate 1.0.7

You can check my repository:

https://github.com/algritz/Livre_recette_v3

@algritz
Copy link
Author

algritz commented Oct 31, 2012

I found out that it could be fixed by using the following option in my application.rb file

config.assets.initialize_on_precompile = true

found the solution there:
refinery/refinerycms#1751

@algritz algritz closed this as completed Oct 31, 2012
@gsanchezd
Copy link

In short:
if you are using heroku just change
config.assets.initialize_on_precompile = true (on apllication.rb)

and then in your project path
heroku labs:enable user-env-compile -a appname

@garyfoster
Copy link

Changing config.assets.initialize_on_precompile to true could cause other side affects, see https://devcenter.heroku.com/articles/rails-asset-pipeline#assets-precompile-failures for details. Another quick hack would be to change the generated letsrate.js.erb to letsrate.js and replace the erb code for the rate_path with the hardcoded path "/rate".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants