1
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

Organization

There was an error while trying to load the gem 'uglifier'. rails でこんなこと言われたら

Bundler::GemRequireError: There was an error while trying to load the gem 'uglifier'.
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/home/usr/vendor/bundle/ruby/2.5.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'

単純にGemfileの↓のコメントアウトを消してbundle installすると治ります

#gem 'therubyracer', platforms: :ruby

どうやらJavaScript のライブラリを、Rubyで使えるようにしたGemっぽいです。
https://github.com/lautis/uglifier/

nodejsをインストールすることで、Gemをinstallしなくても使えるみたいです

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
1
Help us understand the problem. What are the problem?