Installfest- Create a rails app-rails server error


#1

Hello. I got stuck on “Create a rails app” . When i try to run rails s it give me a error:

/home/gali/.rvm/rubies/ruby-2.3.7/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:84:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) 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/gali/.rvm/gems/ruby-2.3.7/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:inautodetect’
/home/gali/.rvm/gems/ruby-2.3.7/gems/execjs-2.7.0/lib/execjs.rb:5:in <module:ExecJS>' /home/gali/.rvm/gems/ruby-2.3.7/gems/execjs-2.7.0/lib/execjs.rb:4:in
/home/gali/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require' /home/gali/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inblock in require_with_bootsnap_lfi’
/home/gali/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register' /home/gali/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:inrequire_with_bootsnap_lfi’
/home/gali/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require' /home/gali/.rvm/gems/ruby-2.3.7/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:inblock in require’
/home/gali/.rvm/gems/ruby-2.3.7/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in load_dependency' /home/gali/.rvm/gems/ruby-2.3.7/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:inrequire’
/home/gali/.rvm/gems/ruby-2.3.7/gems/uglifier-4.1.10/lib/uglifier.rb:5:in `’…

Tried to solve after googleing:

  1. bundle install
  2. sudo apt-get install execjs
  3. gem install therubyracer -v 0.12.3

the result remain the same.I am on Ubuntu 18.04 LTS.
Please help. Thanks.


#2

You need a javascript runtime.

The most common one is node. I would recommend you use nvm to manage it.

Run the install script in that link and open a new terminal.

Then nvm install node in your terminal.


#3

Thanks. Works now.:rocket: