简体   繁体   中英

Ruby on rails uglifier error

On windows and yes, node.js is installed.

I just installed ruby on rails following a video tutorial but when I go to run rails server I get this error:

c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
        from c:/row/dev/Hello_World/config/application.rb:7:in `<top (required)>'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `require'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `block in server'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from c:/row/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

my gemfile does have uglifier in it uglifier is installed, and the bundle install shows uglifier being used.

What might the issue be?

Seems like you don't have JS runtime installed which uglifier need for. You may install nodejs.

That way for doing that on Ubuntu:

sudo apt-get update
sudo apt-get 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