LoginSignup
1
0

More than 3 years have passed since last update.

Apple M1でJekyllを使えるようにする

Posted at

Apple M1でJekyllを動かすのに少し手間取ったのでここに対処法書きます。
自分はrubyの環境も無かったのでその作り方も載せておきます。

homebrewインストール

ターミナルを起動し、以下叩きます。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/kohei/.zprofile

rbenvをインストール

brew install rbenv

/Users/(ユーザ名)/.zshrc に以下追加します。

eval "$(rbenv init -)"

以下コマンドでrbenvのバージョンが表示されればOK.

exec $SHELL -l
rbenv --version

rubyをインストール

以下にて、インストール可能なrubyのバージョンを確認します。

rbenv install --list

以下のように表示されます。
自分は2.7.3のバージョンをインストールしました。

2.5.9
2.6.7
2.7.3
3.0.1
jruby-9.2.17.0
mruby-2.1.2
rbx-5.0
truffleruby-21.0.0
truffleruby+graalvm-21.0.0

Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all / -L' to show all local versions.

以下にてインストール、デフォルトのバージョンを2.7.3にしました。

rbenv install 2.7.3
rbenv global 2.7.3
exec $SHELL -l
ruby --version

jekyllを起動

Gemfile.lockがある場合はそれを削除し、以下実行。
色々試したのですが、依存gemのバージョン固定では実行できず。。

sudo gem install bundler jekyll
bundle exec jekyll serve

メモから復元した情報なので、ちょっと不足あるかもしれません。。。
参考程度にしていただけるとありがたいです。

1
0
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
0