After Ruby 2.4 Upgrade - Error While Trying to Load The Gem 'Uglifier' (Bundler::Gemrequireerror)

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.

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.

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

Rails server fails because of uglifier gem

So, I nuked ruby, long story short. I use rvm, so removing it was pretty easy, and I hadn't gotten much work done on the project anyway. So rvm and associated gems gone. I re-installed rvm, but this time used the option to install rails as well:

https://rvm.io/rvm/install

\curl -sSL https://get.rvm.io | bash -s stable --rails

This got me up and running. So I guess my best advice is to use the rails flag when using rvm.

Error when bundling one year old Rails app on new machine w latest Ruby (2.4.1) + Rails

If you need to remove a gem you should remove it from your Gemfile, not Gemfile.lock.

In your Gemfile: gem 'json', github: 'flori/json', branch: 'v1.8'

bundler creates Gemfile.lock for you after it resolves your dependencies during bundle install, based on whatever's in your Gemfile. Gemfile.lock also specifies gems that are not in your Gemfile but are dependencies of gems that are. Editing it manually is almost guaranteed to cause you problems and fix nothing.

But you probably don't need to remove it at all. Right now you're locked onto a version of json that bundler's having trouble resolving. You should delete Gemfile.lock and let bundler generate a brand new one.

RAILS: gem pg not loaded after upgrading ruby from 2.2 to 2.3.3

Looks like your rails and pg gem versions are incompatible: https://github.com/rails/rails/issues/31673

I see three options:

  • Downgrade pg gem to an older version (probably 0.xx)
  • Upgrade to Rails 5.1.5 or newer
  • Try the hacky workaround described in the github issue (wouldn't recommend)


Related Topics



Leave a reply



Submit