我无法启动 Rails 服务器。显然我没有 JavaScript 运行时。
$ rails s
c:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:94: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.
Run Code Online (Sandbox Code Playgroud)
我去了链接
但我不知道该怎么做。那么我究竟如何“安装”一个 JavaScript 运行时呢?
这里也是我的 GemFile:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.1'
# Use …Run Code Online (Sandbox Code Playgroud)