이것은 실제로 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