Ruby on Rails - $ Rails Server Fails Because Uglifier Gem Could Not Be Found

There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)

You should run following command to install NodeJS in Ubuntu

sudo apt-get install nodejs

or run this for OSX

brew install nodejs

Uglifier is a JS wrapper and it needs a JS runtime running or JS interpreter. I would choose to install NodeJS.

Rails server won't run - Could not find gem error

try bundle install --path vendor/cache

Ruby-on-rails web application could not be started because of 'uglifier'

This is a known issue with therubyracer and Ruby 2.4. There are a couple of additional issues with Ruby 2.4 compatibility which are tracked in their issue tracker at https://github.com/cowboyd/therubyracer/issues/430.

You should use an earlier version of Ruby, e.g. 2.3.3 until a new version is therubyracer is released.

BTW: There are several gems which are not yet compatible with Ruby 2.4. In order to shield you from experiencing a large amount of compatibility issues after a new release, it is probably wise to not upgrade on first day of release

After Ruby 2.4 upgrade - error while trying to load the gem 'uglifier' (Bundler::GemRequireError)

This is an open issue on the uglifier repository: Uglifier doesn't load with Ruby 2.4.0 using The Ruby Racer JS runtime.

It was caused by the unification of Fixnum and Bignum into Integer, in Ruby 2.4.0. Here is the pull request that resolves the issue, which actually lies in therubyracer, not uglifier.

For now, as a temporary fix, you could configure your Gemfile to use the master branch of the repo:

gem 'therubyracer', git: 'https://github.com/cowboyd/therubyracer.git'

Update: therubyracer version 0.12.3 has now been released, which includes the above fix for ruby 2.4 support.



Related Topics



Leave a reply



Submit