Skip to content

Commit

Permalink
Update comment in m2-build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
wildjcrt committed Sep 27, 2024
1 parent f2cc151 commit 4bccef7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions m2-build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash

export LANG="C.UTF-8"
export RUBY_VERSION="3.3.4"
export BUNDLER_VERSION="2.5.16"
export RUBY_VERSION="3.3.4" # $RUBY_VERSION 應該要跟 Gemfile 同步
export BUNDLER_VERSION="2.5.16" # $BUNDLER_VERSION 應該要跟 Gemfile.lock 同步
export PATH="/opt/rubies/ruby-$RUBY_VERSION/bin:$PATH"

# 確認 Ruby 版本,如果不是 $RUBY_VERSION,就用 ruby-build 安裝
# $RUBY_VERSION 應該要跟 Gemfile 同步
current_ruby_version=$(ruby -v | awk '{print $2}')

if [ "$current_ruby_version" != "$RUBY_VERSION" ]; then
Expand Down Expand Up @@ -65,14 +64,14 @@ fi
# middle2 不知道怎麼設定 PATH,因此把 ruby 的執行檔 symlink 到 /usr/local/bin
if [ ! -e /usr/local/bin/gem ]; then
set -eux; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/bundle" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/bundler" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/erb" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/gem" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/irb" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/racc" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/rake" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/ruby" /usr/local/bin/
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/bundle" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/bundler" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/erb" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/gem" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/irb" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/racc" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/rake" /usr/local/bin/; \
ln -s "/opt/rubies/ruby-$RUBY_VERSION/bin/ruby" /usr/local/bin/
fi

# 確認 bundler 版本並安裝
Expand Down

0 comments on commit 4bccef7

Please sign in to comment.