I keep getting this error:
throw Error("LoadError:cannot load such file -- uglifier\n (in /var/www/dev/app)
I can't handle this error on Rails 4.1.4. This is my Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.1.4'
gem 'mysql2'
gem 'jquery-rails'
gem 'devise'
gem 'spring', group: :development
gem 'unicorn'
I tried to keep the app as light as possible so I removed turbolinks, and all those initial gems:
-gem 'sass-rails', '~> 4.0.3'
-gem 'uglifier', '>= 1.3.0'
-gem 'coffee-rails', '~> 4.0.0'
-gem 'turbolinks'
I used rake assets:precompile
or RAILS_ENV=production rake assets:precompile
and I keep getting that the JS file wrong compiled.
This is my application.js:
//= require jquery
//= require jquery_ujs
//= require_tree .
And this is my production.rb:
# Compress JavaScripts and CSS.
# config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true
config.assets.precompile = ['*.js', '*.css', '*.css.erb']
I know this is an old question, but in case some people are having this same issue, I decided to answer.
Try removing the uglifier gem from your Gemfile entirely and don't forget to 'bundle install'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With