-1

I'm learning ruby on rails on windows platform in windows 8. Now I'm in the database part where rake db:schema:dump command should create a file in config folder named schema.rb, but that's not happening. When I'm typing rake db:schema:dump it shows rake aborted and a long list. Please help.

Here is what shows up in console:

C:\Users\New User\sites2\learning_rails>rake db:schema;dump
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'uglif
ier'.
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/r
ails/execjs for a list of available runtimes.
Backtrace for gem load error is:
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in
 `autodetect'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:
ExecJS>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (re
quired)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `requ
ire'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `<top
 (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:
in `require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:
in `block (2 levels) in require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:
in `each'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:
in `block in require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:
in `each'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:
in `require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `req
uire'
C:/Users/New User/sites2/learning_rails/config/application.rb:7:in `<top (requir
ed)>'
C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in
 `require'
C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in
 `require'
C:/Users/New User/sites2/learning_rails/Rakefile:4:in `<top (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in
 `load'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in
 `load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:689:i
n `raw_load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:94:in
 `block in load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:176:i
n `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:93:in
 `load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:77:in
 `block in run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:176:i
n `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:75:in
 `run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/bin/rake:33:in `<top (require
d)>'
C:/Ruby22-x64/bin/rake:22:in `load'
C:/Ruby22-x64/bin/rake:22:in `<main>'
Bundler Error Backtrace:
C:/Users/New User/sites2/learning_rails/config/application.rb:7:in `<top (requir
ed)>'
C:/Users/New User/sites2/learning_rails/Rakefile:4:in `<top (required)>'
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://git
hub.com/rails/execjs for a list of available runtimes.
C:/Users/New User/sites2/learning_rails/config/application.rb:7:in `<top (requir
ed)>'
C:/Users/New User/sites2/learning_rails/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
Roman
  • 5,586
  • 1
  • 17
  • 37
Amaresh Dey
  • 3
  • 1
  • 5
  • 1
    Possible duplicate of [There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)](http://stackoverflow.com/questions/34420554/there-was-an-error-while-trying-to-load-the-gem-uglifier-bundlergemrequire) – Dave Schweisguth Jun 02 '16 at 21:35
  • 1
    In the future, please include errors as text, not screenshots. Screenshots can't be searched for or copied, and are less convenient to read. – Dave Schweisguth Jun 02 '16 at 21:36
  • no its not working till now. – Amaresh Dey Jun 02 '16 at 22:03

1 Answers1

0

install nodejs

Uglifier is JavaScript compressor, so it need javascript runtime try installing nodejs

apt-get install nodejs

or

brew install nodejs

if you are on a OSX.

Dharmesh Rupani
  • 1,011
  • 2
  • 12
  • 22
  • @AmareshDey you can download node.js from here [ https://nodejs.org/en/download/ ], else you can follow this installation guide [ http://blog.teamtreehouse.com/install-node-js-npm-windows ] – Dharmesh Rupani Jun 02 '16 at 22:27