如何在Bundle Gemfile中强制使用某个版本?

时间:2014-09-28 07:13:04

标签: ruby bundler jekyll gemfile

这是我的Gemfile

source 'https://rubygems.org'
gem 'jekyll', '~> 2.4.0'
gem 'fontcustom', '~> 1.3.3'

这就是我得到的:

$ bundle update
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "listen":
  In Gemfile:
    fontcustom (~> 1.3.3) ruby depends on
      listen (~> 1.0) ruby

    jekyll (~> 2.4.0) ruby depends on
      jekyll-watch (~> 1.1) ruby depends on
        listen (2.7.0)

什么是变通方法?我需要使用jekyll 2.4.0。

1 个答案:

答案 0 :(得分:1)

有人提交了拉取请求以支持在fontcustom中监听v1和v2:https://github.com/FontCustom/fontcustom/pull/191不幸的是,它还没有被接受。

您可以将Gemfile更改为

来使用分叉版本
source 'https://rubygems.org'
gem 'jekyll', '~> 2.4.0'
gem 'fontcustom', git: 'https://github.com/twalpole/fontcustom.git', branch: 'listen'

然后,运行bundle install