LoginSignup
1
1

More than 3 years have passed since last update.

windows環境でmiddleman実行時に詰まったことメモ+解決策

Posted at

最初に注意

※ごり押しでの解決策です。あまり推奨できる方法ではありません。どうしても動かさねばならない時に参考にしてください。

やろうとしたこと

middlemanを使って静的サイトを作ろうとした。
が、エラー吐く。middlemanが動かねぇ。困った。

最初にやってたこと

$gem install middleman
$middleman init プロジェクト名
$cd プロジェクト名

コマンドプロプトに以上を打ち込む。ここまではmiddleman公式と同じ。

そしてエラーが起こる

$middleman

Could not find gem 'middleman-autoprefixer (~> 2.7) x64-mingw32' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
$bundle install

The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x64-mingw32 but the dependency is only for x86-mswin32, x86-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32 java`.
The dependency wdm (~> 0.1) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x64-mingw32 but the dependency is only for x86-mswin32, x86-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32`.
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Unable to find a spec satisfying tzinfo-data (>= 0) in the set. Perhaps the
lockfile is corrupted?

うるせー!知らねー!(解決編)

プロジェクトファイルに、Gemfileってのがあると思います。それをエディタで開いて以下のように修正します。

Gemfile.rb
source 'https://rubygems.org'

gem 'middleman', '~> 4.2'
gem 'middleman-autoprefixer'#, '~> 2.7'
#gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby]
gem 'wdm'#, '~> 0.1', platforms: [:mswin, :mingw]

御覧の通り、バージョン指定部分を消しただけの3分クッキング。

結果どうなったか

$middleman

== The Middleman is loading
(以下略)

うまくいった!やったぜ

参考にしたサイト

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1