1
votes

I've got a Rails 3.2.8 application which appears to be working nicely in my development environment however when deployed to Heroku the asset pipeline is no longer compiling my assets correctly - or at least, not loading in my dependencies.

The resulting 'compiled' js asset for instance which is found on http://myappsubdomain.herokuapp.com/assets/application-b389f6c8ee6250ebc143feb659f40ed9.js contains the raw source code:

//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require twitter/bootstrap
//= require_tree .
$(".tip").tooltip();

This is also true of my CSS assets, which include any styles placed directly in my application.css, but with none of the required dependant assets loaded in.

The precompile seems to run during deployment without error:

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       Asset precompilation completed (8.79s)

I notice that if I manually run "heroku run rake asset:precompile" I runs without error, only a couple of depreciation notices.

If I enabled asset compilation in my development environment everything appears to be squashed in to the single included asset just fine, as I would expect.

Can anyone offer any advice on this?

1
Because running the compilation locally seems to work without problem I've rolled back to that approach rather than having Heroku compile the assets as part of the slug - I am still none the wiser as to why this isn't working direct on Heroku though.SirRawlins

1 Answers

0
votes

After some more experimentation I noted that the new Heroku instance I had provisions was running on Ruby 2 (obviously in prep for Rails 4) but my development environment and existing heroku instances running this given code base were on 1.9.3.

I have updated my Gemfile to include the explicite definition of the Ruby version and things now appear to work wonderfully when deployed.