Pregunta

Since adding shopify_app gem and generating the files from it on my Rails 4 project, I cannot push the changes to Heroku.

The app seems to run fine locally.

Terminal output snippet...

.
.
.
I, [2014-02-19T18:22:21.534285 #633]  INFO -- : Writing /tmp/build_7560eb7a-eac1-486b-92a8-81484f0223bb/public/assets/shopify-1336e1537a57a0c4469a113563298c80.png
rake aborted!
cannot load such file -- v8
(in /tmp/build_7560eb7a-eac1-486b-92a8-81484f0223bb/app/assets/stylesheets/imports.css.less)
/tmp/build_7560eb7a-eac1-486b-92a8-81484f0223bb/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
.
.
.

imports.css.less

/*
 * Temporary fix until less-rails-bootstrap fixes issue #26 https://github.com/metaskills/less-rails-bootstrap/issues/26
 */

 @import "twitter/bootstrap/responsive";

I have tried adding the bootstrap file being requested into app/assets/stylesheets/twitter/bootstrap/responsive.less and also tried commenting out the line in question - each time making a commit before pushing to Heroku.

I have had this problem in the past and added config.assets.initialize_on_precompile = false to the Application class of application.rb, but this time that does not help.

¿Fue útil?

Solución

I have managed to fix it by adding this to the Application class of config/application.rb like I had tried before...

config.assets.initialize_on_precompile = false`

but this time also adding this to config/environment/production.rb...

config.assets.compile = true

It means that I have to run this each time I have changed the assets and want to push the commit to Heroku....

rake assets:precompile

All this to prevent the Heroku precompile error, as it tries to initialise and attach to the DB before the ENV vars are available.

[source]

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top