向已经包含该行代码的Gemfile添加代码行

时间:2015-09-22 17:58:15

标签: ruby jekyll jekyll-bootstrap

我的博客基于Jekyll Bootstrap,我最近在Windows 10上安装了一台新机器。

当我在本地计算机上启动服务器进行测试时,它说我应该在我的Gemfile中添加一些内容:

$ jekyll serve -w
Configuration file: C:/Users/mark/Documents/ploeh/Blog/_config.yml
            Source: C:/Users/mark/Documents/ploeh/Blog
       Destination: C:/Users/mark/Documents/ploeh/Blog/_site
      Generating...
                    done.
  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
 Auto-regeneration: enabled for 'C:/Users/mark/Documents/ploeh/Blog'
Configuration file: C:/Users/mark/Documents/ploeh/Blog/_config.yml
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

如您所见,它告诉我在我的Gemfile中添加一行。不幸的是,我已经尝试过这样做,但似乎没有任何区别:

$ cat Gemfile
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
source 'https://rubygems.org'

如您所见,有问题的行已存在于我的Gemfile中。

在Gemfile中移动东西并没有任何区别:

source 'https://rubygems.org'
gem 'wdm', '>= 0.1.0' if Gem.win_platform?

为什么这么说,我应该关心吗?如果我应该关心,那我该如何解决这个问题?

如果重要,请查看我的Ruby版本:

$ ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]

其他版本信息:

$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.6)
blankslate (2.1.2.4)
celluloid (0.16.0)
classifier-reborn (2.0.3)
coffee-script (2.4.1)
coffee-script-source (1.9.1.1)
colorator (0.1)
execjs (2.6.0)
fast-stemmer (1.0.2)
ffi (1.9.10 x64-mingw32)
hitimes (1.2.2)
io-console (0.4.3)
jekyll (2.5.3)
jekyll-coffeescript (1.0.1)
jekyll-gist (1.3.4)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.3.0)
jekyll-watch (1.2.1)
json (1.8.1)
kramdown (1.8.0)
liquid (2.6.3)
listen (2.10.1)
mercenary (0.3.5)
minitest (5.4.3)
parslet (1.5.0)
posix-spawn (0.3.11)
power_assert (0.2.2)
psych (2.0.8)
pygments.rb (0.6.3)
rake (10.4.2)
rb-fsevent (0.9.6)
rb-inotify (0.9.5)
rdoc (4.2.0)
redcarpet (3.3.2)
safe_yaml (1.0.4)
sass (3.4.18)
test-unit (3.0.8)
timers (4.0.4)
toml (0.1.2)
yajl-ruby (1.2.1)

1 个答案:

答案 0 :(得分:4)

在控制台中输入gem install wdm,看看是否可以解决问题。