1

I am new to Ruby on Rails and I was trying to learn it using the youtube videos and I have installed Heroku, Postgre SQL, Git Bash and trying to run the Rails Server and getting the following error.

Can you guys help me out on this? There was similar issue posted here I tried using the resolution provided there but it did not work.

  • Tried uncommening the # gem 'therubyracer', platforms: :ruby that did not work

  • People mentioned that we need to install Nodejs although I have nodejs in my system I am not using it should I install it even though I am not going to use it?

Please help me on this.

$ rails s

c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:85: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: c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:inautodetect' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in <module:ExecJS>' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/uglifier-4.1.10/lib/uglifier.rb:5:in require' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/uglifier-4.1.10/lib/uglifier.rb:5:in' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:82:in require' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:82:inblock (2 levels) in require' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:77:in each' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:77:inblock in require' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:66:in each' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:66:inrequire' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler.rb:108:in require' c:/Sites/myrubyblog/config/application.rb:7:in' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in require' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:inblock in perform' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in tap' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:inperform' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in run' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:ininvoke_command' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in dispatch' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:inperform' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command.rb:44:in invoke' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in' bin/rails:4:in require' bin/rails:4:in' Bundler Error Backtrace: from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:81:in block (2 levels) in require' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:77:ineach' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:77:in block in require' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:66:ineach' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:66:in require' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler.rb:108:inrequire' from c:/Sites/myrubyblog/config/application.rb:7:in <top (required)>' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:inrequire' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in block in perform' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:intap' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in perform' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:inrun' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:indispatch' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in perform' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command.rb:44:ininvoke' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in <top (required)>' from bin/rails:4:inrequire' from bin/rails:4:in `'

2 Answers 2

0

The error is "Cannot Find a Javascript Runtime" because you are using Uglifier.

Uglifier is a JS wrapper and it needs a JS runtime running.

NodeJS is my recommendation.

2
  • I have node js.in system which was installed long back. What should I do now? I tried npm install express This is also mot working
    – user8268874
    May 20, 2018 at 10:08
  • Run the commands "node -v" and "npm -v" to check they are installed in command prompt or ps. If they are installed it will show their version numbers. If it doesn't, go get a new installation of NodeJS and make sure to enable the npm Package manager in the installation May 20, 2018 at 10:14
0

Installing NodeJS should fix your issue.

You can install it using the installer here: https://nodejs.org/en/download/

Or use sudo apt-get install NodeJS or equivalent, depending on your system, on the command line

1
  • Can I install it separately or I need to install from Git Bash?
    – user8268874
    May 20, 2018 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.