简体   繁体   中英

I got a long error after executing rails server command during the first project creation after installation of rails

C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bu
ndler/runtime.rb:81:in `rescue in block (2 levels) in require': There was an err
or while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
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:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs/run
times.rb:58:in `autodetect'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs.rb:
5:in `<module:ExecJS>'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs.rb:
4:in `<top (required)>'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/uglifier-3.0.2/lib/uglifier
.rb:5:in `require'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/uglifier-3.0.2/lib/uglifier
.rb:5:in `<top (required)>'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bu
ndler/runtime.rb:78:in `require'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bu
ndler/runtime.rb:78:in `block (2 levels) in require'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bu
ndler/runtime.rb:73:in `each'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bu
ndler/runtime.rb:73:in `block in require'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bu
ndler/runtime.rb:62:in `each'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bu
ndler/runtime.rb:62:in `require'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bu
ndler.rb:102:in `require'
C:/Sites/Dem/config/application.rb:7:in `<top (required)>'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/
commands/commands_tasks.rb:78:in `require'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/
commands/commands_tasks.rb:78:in `block in server'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/
commands/commands_tasks.rb:75:in `tap'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/
commands/commands_tasks.rb:75:in `server'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/
commands/commands_tasks.rb:39:in `run_command!'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/
commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0
.pre.1/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0
.pre.1/lib/bundler/runtime.rb:73:in `each'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0
.pre.1/lib/bundler/runtime.rb:73:in `block in require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0
.pre.1/lib/bundler/runtime.rb:62:in `each'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0
.pre.1/lib/bundler/runtime.rb:62:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.0
.pre.1/lib/bundler.rb:102:in `require'
        from C:/Sites/Dem/config/application.rb:7:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5
.1/lib/rails/commands/commands_tasks.rb:78:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5
.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5
.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5
.1/lib/rails/commands/commands_tasks.rb:75:in `server'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5
.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5
.1/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

it sounds like this is the important part of the error

(Bundler::GemRequireError)Gem Load Error is: Could not find a JavaScript runtime.

it can't find a javascript runtime on your machine, which likely means you need to install nodejs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM