Reputation: 11
I just installed RoR and everything seems good. But when I finally loaded everything, to start the page localhost:3000
I first get this error in the command prompt:
C:\ruby\rails\firstapp>rails server
C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/runtime.rb:89:
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:/ruby/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
C:/ruby/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
C:/ruby/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
C:/ruby/lib/ruby/gems/2.1.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `require'
C:/ruby/lib/ruby/gems/2.1.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `<top (required)>'
C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/runtime.rb:86:
in `require'
C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/runtime.rb:86:
in `block (2 levels) in require'
C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/runtime.rb:81:
in `each'
C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/runtime.rb:81:
in `block in require'
C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/runtime.rb:70:
in `each'
C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/runtime.rb:70:
in `require'
C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler.rb:104:in `req
uire'
C:/ruby/rails/firstapp/config/application.rb:7:in `<top (required)>'
C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/commands_task
s.rb:78:in `require'
C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/commands_task
s.rb:78:in `block in server'
C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/commands_task
s.rb:75:in `tap'
C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/commands_task
s.rb:75:in `server'
C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/commands_task
s.rb:39:in `run_command!'
C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<to
p (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
from C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/r
untime.rb:85:in `block (2 levels) in require'
from C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/r
untime.rb:81:in `each'
from C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/r
untime.rb:81:in `block in require'
from C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/r
untime.rb:70:in `each'
from C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler/r
untime.rb:70:in `require'
from C:/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.13.0.pre.1/lib/bundler.r
b:104:in `require'
from C:/ruby/rails/firstapp/config/application.rb:7:in `<top (required)>
'
from C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/
commands_tasks.rb:78:in `require'
from C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/
commands_tasks.rb:78:in `block in server'
from C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/
commands_tasks.rb:75:in `tap'
from C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/
commands_tasks.rb:75:in `server'
from C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands/
commands_tasks.rb:39:in `run_command!'
from C:/ruby/lib/ruby/gems/2.1.0/gems/railties-4.2.6/lib/rails/commands.
rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
C:\ruby\rails\firstapp>
After that I search the page localhost:3000
and nothing but page error displays.
I though it's the ruby that's the problem, so I uninstalled it, changed the version (I now use 2.1.8) and still does not help. Please I really need help on this?
Upvotes: 0
Views: 181
Reputation: 11823
The problem is that your environment is missing a JavaScript runtime. It can be node.js
as suggested by other answers, but it is not limited to that.
Execjs supports:
So, you can actually use one of runtimes that is well fit to your environment.
Upvotes: 0
Reputation: 3376
You need to install nodejs for Javascript runtime
https://nodejs.org/en/download/
Upvotes: 0
Reputation: 780
are you on OSX or Linux?
osx: brew install nodejs
linux: sudo apt-get install nodejs
god help you if you are doing this from Windows..
Upvotes: 1