Fixing ugly Rails uglifier error

More in the notes-to-self to unblock problems with Rails (and ruby in general).

I have just been working on a new project and got the following error when trying to create the very first scaffold:

rails g scaffold crossword_setters name:string setter_type_id:integer 
/home/julian/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)

Okay? So this is telling me that I am missing a dependency, but keeping the essential details hidden.

A quick bit of searching suggests that uglifier depends on a JavaScript library; I typically  use ‘therubyracer‘.

I was still getting the error after installing both the ‘therubyracer’ and ‘libv8′ gems, having neglected to make sure that it had been enabled in the Gemfile. This last step is the fix.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s