結論から言うと、ローカルでbundle install
した際に生成されたGemfile.lockを修正したら上手くいきました。
# 修正前
PLATFORMS
x64-mingw32
# 修正後
PLATFORMS
PLATFORMS
の指定を空にしました。wercker上でbundle
実行する際に指定できればいいんですが、
できなさそうだったので致し方なく。
では、以下はここに至るまでのプロセスです(おまけ)。
経緯(おまけ)
最初のエラーはこちらでした。
Gemfile found. Start bundle install.
bundler gem is available, and will not be installed by this step
type bundle: bundle is /usr/local/bin/bundle
bundle version: Bundler version 1.3.0
bundle install --path /cache/bundle-install/
Fetching gem metadata from http://rubygems.org/........
Resolving dependencies...
You have requested:
jekyll >= 0
The bundle currently has jekyll locked at 2.5.2.
Try running `bundle update jekyll`
「あなたはjekyllの0以上を要求していますがbundleは2.5.2以上でロックしてますよ」と。 「じゃあ2.5.2入れてください」って思いますが、そうはならないのがbundleの不思議。
ちなみにこの時のGemfileは以下。
source 'http://rubygems.org'
gem 'jekyll'
gem 'redcarpet'
gem 'compass'
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i
gem 'wdm', '>= 0.1.0'
end
特にjekyllのバージョンは指定しません。
これに基づいてbundle update
して出来上がっていたGemfile.lockはこちら。
GEM
remote: http://rubygems.org/
specs:
blankslate (2.1.2.4)
celluloid (0.16.0)
timers (~> 4.0.0)
chunky_png (1.3.3)
classifier-reborn (2.0.2)
fast-stemmer (~> 1.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.8.0)
colorator (0.1)
compass (1.0.1)
chunky_png (~> 1.2)
compass-core (~> 1.0.1)
compass-import-once (~> 1.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
sass (>= 3.3.13, < 3.5)
compass-core (1.0.1)
multi_json (~> 1.0)
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
execjs (2.2.2)
fast-stemmer (1.0.2)
ffi (1.9.6-x64-mingw32)
hitimes (1.2.2)
jekyll (2.5.2)
classifier-reborn (~> 2.0)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-gist (1.1.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.2.1)
sass (~> 3.2)
jekyll-watch (1.1.2)
listen (~> 2.7)
kramdown (1.5.0)
liquid (2.6.1)
listen (2.8.3)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
multi_json (1.10.1)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.9)
pygments.rb (0.6.0)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.2.1)
safe_yaml (1.0.4)
sass (3.4.9)
timers (4.0.1)
hitimes
toml (0.1.2)
parslet (~> 1.5.0)
wdm (0.1.0)
yajl-ruby (1.1.0)
PLATFORMS
x64-mingw32
DEPENDENCIES
compass
jekyll
redcarpet
wdm (>= 0.1.0)
確かにGemfile.lockでは2.5.2以上になってますね。 Gemfileでバージョン指定しておらず、一方でGemfile.lockでバージョン指定したらGemfile.lockが優先されると思っていたのですがそうじゃないのかな?
試しに、ローカルのGemfileのjekyllにバージョン指定の記述を追加します。
source 'http://rubygems.org'
gem 'jekyll','2.5.2'
gem 'redcarpet'
gem 'compass'
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i
gem 'wdm', '>= 0.1.0'
end
一応、bundle update
もしておきます。ローカルは問題なく動作。
しかしwerckerではbuildエラーが出ています。
bundle install --path /cache/bundle-install/
Fetching gem metadata from http://rubygems.org/........
Resolving dependencies...
You have requested:
jekyll = 2.5.2
The bundle currently has jekyll locked at 2.5.2.
Try running `bundle update jekyll`
指定あってるじゃん!なのにエラー。意味がわかりません。このあたりから「バージョン指定の問題ではないのでは?」と感じます。
試しにGemfile.lockを退避させてwerckerでbuildしてみます。すると・・・
build通った。
Gemfile found. Start bundle install.
bundler gem is available, and will not be installed by this step
type bundle: bundle is /usr/local/bin/bundle
bundle version: Bundler version 1.3.0
bundle install --path /cache/bundle-install/
Fetching gem metadata from http://rubygems.org/........
Resolving dependencies...
Using blankslate (2.1.2.4)
Using hitimes (1.2.2)
Using timers (4.0.1)
Using celluloid (0.16.0)
Using chunky_png (1.3.3)
Using fast-stemmer (1.0.2)
Using classifier-reborn (2.0.2)
Using coffee-script-source (1.8.0)
Using execjs (2.2.2)
Using coffee-script (2.3.0)
Using colorator (0.1)
Using multi_json (1.10.1)
Installing sass (3.4.9)
Using compass-core (1.0.1)
Using compass-import-once (1.0.5)
Using rb-fsevent (0.9.4)
Using ffi (1.9.6)
Using rb-inotify (0.9.5)
Using compass (1.0.1)
Using jekyll-coffeescript (1.0.1)
Using jekyll-gist (1.1.0)
Using jekyll-paginate (1.1.0)
Using jekyll-sass-converter (1.2.1)
Installing listen (2.8.3)
Using jekyll-watch (1.1.2)
Using kramdown (1.5.0)
Using liquid (2.6.1)
Using mercenary (0.3.5)
Using posix-spawn (0.3.9)
Using yajl-ruby (1.1.0)
Using pygments.rb (0.6.0)
Installing redcarpet (3.2.1)
Using safe_yaml (1.0.4)
Using parslet (1.5.0)
Using toml (0.1.2)
Installing jekyll (2.5.2)
Using bundler (1.3.0)
Your bundle is complete! It was installed into /cache/bundle-install
finished bundle install --path /cache/bundle-install/
skipping rbenv rehash because rbenv is not found
なんで通るのか。退避させたGemfile.lockと内容付け合わせてみました。
# Gemfile.lockで記述されてないのに、wercker上でインストールされたもの。
bundler(1.3.0)
# Gemfile.lockで記述されてたのにwercker上でインストールされなかったもの。
wdm(0.1.0) # これはWinのためのモジュールなのでよい
parslet(1.5.0) # これはシンタックスハイライトのためのツール。
# 微妙にバージョンが異なっていたもの。
ffi(1.9.6) <-- bundler
ffi(1.9.6-x64-mingw32) <-- Gemfile.lock
ここで気づきまして、「あ、OSの差の問題だ」と。で、Gemfile.lock見たら
PLATFORMS
x64-mingw32
となっていたので、これを外してwerckerでbuild成功して終了。但し、根本的な原因は依然不明のままです。詳しい人いたら教えてほしい・・。
それにしてもbundlerは便利なのですが、環境の差を完璧に吸収してくれるものでもないですし、あまり頼りすぎるのも問題なのかなぁと感じた次第です。