Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake assets:precompile aborting, can't push to heroku

I'm using Enki blogging gem, it works locally, trying to prepare to push to heroku (never had a problem before). I tried to precompile and it did this

/Users/me/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby /Users/me/.rvm/gems/ruby-1.9.3-rc1@ruby193/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
cannot load such file -- uglifier
  (in /Users/me/Sites/bayani/app/assets/javascripts/admin.js)

I've never had trouble pushing an Enki blog to Heroku before and, although I don't know where uglifier is, I recall having seen it in other Enki blogs I've pushed, so I don't know why it's creating problems now.

When I pushed to Heroku and it aborted the precompile as well

Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       no such file to load -- uglifier
       (in /tmp/build_5tbsi7k7ddhk/app/assets/javascripts/admin.js)
       Tasks: TOP => assets:precompile:primary
       (See full trace by running task with --trace)
       Precompiling assets failed, enabling runtime asset compilation
       Injecting rails31_enable_runtime_asset_compilation
       Please see this article for troubleshooting help:
       http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting

After reading the troubleshooting article at the link it provided, I put this in application.rb

config.assets.initialize_on_precompile = false

but I'm still having the same problem

This is admin.js. It's just a manifest file. this is the link to enki https://github.com/xaviershay/enki

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require jquery.livequery
//= require jquery.form
//= require jquery.easing.1.3
//= require humanmsg
//= require_tree ./admin
like image 273
Leahcim Avatar asked Dec 12 '22 00:12

Leahcim


1 Answers

Add following to Gemfile.

group :assets do
  gem 'therubyracer'
  gem 'sass-rails', "  ~> 3.1.0"
  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'
end

Run

bundle install

rake assets:precompile

I hope, It will be useful .

like image 132
Shamith c Avatar answered Dec 25 '22 04:12

Shamith c