LoginSignup
5
1

More than 5 years have passed since last update.

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

Posted at
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しなくても使えるみたいです

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1