5

On pushing the Rails4 code to heroku I get the following error, this has started happening in last 2 days, which otherwise a smooth process

 Writing config/database.yml to read from DATABASE_URL
  -----> Preparing app for Rails asset pipeline
   Running: rake assets:precompile
   rake aborted!
   couldn't find file '/tmp/build_b6402ff8-bda2-4bc5-95dc-2efe7a9044bc/tmp/i18n-js.cache'
   (in /tmp/build_b6402ff8-bda2-4bc5-95dc-2efe7a9044bc/vendor/bundle/ruby/2.0.0/gems/i18n-js-2.1.2/vendor/assets/javascripts/i18n/translations.js.erb)
   /tmp/build_b6402ff8-bda2-4bc5-95dc-2efe7a9044bc/vendor/bundle/ruby/2.0.0/gems/sprockets-2.10.0/lib/sprockets/context.rb:87:in `resolve'

Here is entry from my production.rb

config.assets.initialize_on_precompile = true

I am able to run RAILS_ENV=production rake assets:precompile locally. Though I am not pushing the precompiled assets to the server.

I am get I18n-js 2.1.2 version installed through my gem files, its Rails4 server running for me.

halfer
  • 19,824
  • 17
  • 99
  • 186
sudhanshu
  • 462
  • 5
  • 17

3 Answers3

6

Bumping up the asset version seems to work. Change the following line in application.rb:

config.assets.version = '1.0'
andac
  • 61
  • 2
  • This worked for me ! None of the other solutions worked). I had git://github.com/torandi/i18n-js.git (at rails4) as dependency – Adrien Feb 10 '14 at 16:05
  • Worked for me too, thanks. Reported it at Github:https://github.com/fnando/i18n-js/issues/189 – wspruijt Mar 11 '14 at 17:05
0

Try clearing your tmp folder using the following rake task:

rake tmp:clear

This will allow Heroku to do a fresh precompile of all of your assets.

Ryan Francis
  • 635
  • 6
  • 7
0

I got rid of i18n-js rails gem, to get the problem fixed. I was using it minimally so replaced it with some small code of mine.

There are problems with the Gem and Rails 4 when deploying on Heroku.

sudhanshu
  • 462
  • 5
  • 17