无法启动中间人服务器

时间:2018-01-10 20:35:43

标签: ruby gemfile middleman

我已安装 middlemanapp ,并且在尝试启动本地服务器后,系统要求安装捆绑包。我安装了它,一切都很好。

这是我的Gemfile:

source 'https://rubygems.org’
gem 'nokogiri’
gem ‘rack’, '~> 2.0.1’
gem ‘rspec’

当我进入中间人服务器时,我收到以下错误:

Please report a bug if this causes problems.
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/middleman-cli-4.2.1/bin/middleman:12:in require': cannot load such file -- dotenv (LoadError) from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/middleman-cli-4.2.1/bin/middleman:12:in<top (required)>'
from C:/Ruby24-x64/bin/middleman:23:in load' from C:/Ruby24-x64/bin/middleman:23:in’

我该怎么办?

1 个答案:

答案 0 :(得分:0)

你必须在你的Gemfile中添加中间人:

source 'https://rubygems.org'

ruby '2.4.2'

# For faster file watcher updates on Windows:
gem 'wdm', '~> 0.1.1', platforms: [:mswin, :mingw]

# windows does not come with time zone data
gem 'tzinfo-data', platforms: [:mswin, :mingw]

# Middleman Gems
gem 'middleman', '~> 4.2', '>= 4.2.1'
gem 'middleman-livereload'

# Your Gems
gem 'nokogiri', '~> 1.8', '>= 1.8.1'
gem 'rack', '~> 2.0', '>= 2.0.3'

# Development
group :development, :test do
  gem 'rspec', '~> 3.7'
end

并运行:

bundle install