asdfとバンドルに関するヘルプ

これは実際には Discourse の問題ではありませんが、Discourse でのみ発生しています。他の検索も行いましたが、うまくいかなかったため、ここにいます。

新しくクローンした discourse ディレクトリで bundle install を実行すると、次のようになります。

(main) pfaffman@noreno:~/discourse$ bundle install
/home/pfaffman/.asdf/installs/ruby/3.2.2/bin/bundle:25:in `load': cannot load such file -- /home/pfaffman/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle (LoadError)

プラグインが含まれているディレクトリで実行すると、問題なく動作します。しばらく前に、Discourse をクローンして bundle install を機能させることができたと記憶していますが、その後停止しました。

ここで、適切なバージョンのものを設定しようとしました。これは何らかの問題の原因になっていると思います。数ヶ月、あるいは1年ほど、最新の Docker イメージから適切なバージョンのものを取得するためにこれが機能していました。

  DISCOURSE_SRC=/home/pfaffman/src/discourse-repos/discourse
  DISCOURSE_DOCKER_SRC=/home/pfaffman/src/discourse-repos/discourse_docker
  cd $DISCOURSE_SRC

  git -C $DISCOURSE_DOCKER_SRC pull https://github.com/discourse/discourse_docker
  DISCOURSE_BASE=$(grep -e ^image= $DISCOURSE_DOCKER_SRC/launcher|cut -d'\"' -f2)
  cd -

  docker pull $DISCOURSE_BASE
  asdf plugin add nodejs #https://github.com/asdf-vm/asdf-nodejs.git
  asdf plugin add ruby #https://github.com/asdf-vm/asdf-ruby.git
  asdf plugin add imagemagick
  asdf plugin update --all
  RUBY_VERSION=$(grep -e ^RUBY_VERSION $DISCOURSE_DOCKER_SRC/image/base/install-ruby|cut -d'\"' -f2)
  echo "GOT RUBY VERSION!! $RUBY_VERSION"
  asdf install ruby $RUBY_VERSION
  asdf global ruby $RUBY_VERSION
  IMAGE_MAGICK_VERSION=$(grep -e ^IMAGE_MAGICK_VERSION ~//src/discourse-repos/discourse_docker/image/base/install-imagemagick|cut -d'\"' -f2)
  echo "GOT IMAGE_MAGICK_VERSION: $IMAGE_MAGICK_VERSION"
  asdf install imagemagick $IMAGE_MAGICK_VERSION
  asdf global imagemagick $IMAGE_MAGICK_VERSION
  # 2023-04-24 debian and pop!os have different nodejs versions
  NODE_VERSION=$(docker run discourse/base:release bash -c 'node --version'|cut -d'v' -f2)
  #NODE_VERSION=$(grep node ~/src/discourse-repos/discourse/.tool-versions|awk '{print $2}')
  echo "GOT NODEJS version: $NODE_VERSION"
  asdf install nodejs $NODE_VERSION
  asdf global nodejs $NODE_VERSION
  npm install -g yarn
  sleep 2
  # end of version updates
  cd $DISCOURSE_SRC
  git checkout main
  git pull
  bundle install
  ./bin/rake db:migrate
  RAILS_ENV=test ./bin/rake db:migrate
  git checkout main
  git pull
  bundle install
  yarn install
  ./bin/rake db:migrate
  RAILS_ENV=test ./bin/rake db:migrate
  exit
「いいね!」 1

ようやく修正しました。

gem install bundler -v 2.5.3

なぜそれが望んでいたバージョンをインストールするのを認識しなかったのか分かりません。

「いいね!」 3

このトピックは、最後の返信から30日後に自動的にクローズされました。新しい返信は許可されていません。