pfaffman
(Jay Pfaffman)
4월 21, 2023, 6:06오후
1
Falco:
제가 사용하는 많은 도구의 버전을 관리하기 위해 asdf 를 사용해 왔기 때문에, 제 입장에서는 그냥
asdf install ruby 3.1.3
asdf local ruby 3.1.3
이렇게 하면 됩니다.
하지만 이제 Discourse는 3.2.1을 요구하는데, asdf는 3.2.1에 대해 모르는 것 같습니다. 여러분은 어떻게 관리하고 계신가요?
asdf list all ruby|grep 3.2.1
을 실행하면 아무 결과도 나오지 않습니다.
여러분의 업무에 루비 버전 벤치마킹이 포함되어 있으므로 그건 충분히 합리적입니다. 하지만 CDCK 안팎의 개발자 대부분은 imagemagick(또는 다른 것)이 올바르게 컴파일되도록 필요한 라이브러리가 무엇인지 알 필요 없이, 단순히 작동하는 개발 환경만 필요하지 않나요?
sam
(Sam Saffron)
4월 24, 2023, 12:04오전
2
ruby-build에는 분명히 3.2.1이 있으므로, 사용자 측에서 업데이트가 필요합니다.
opened 09:32AM - 14 Jun 21 UTC
closed 04:57PM - 12 Nov 21 UTC
It seems a frequent issue (notably #207, #204 but I think quite a few others) i… s that ruby-build in this plugin can be quite outdated.
For instance the current release is `ruby-build 20210611` but this plugins default to:
https://github.com/asdf-vm/asdf-ruby/blob/f134c2df390bd8b32c33de5330d61e77b70ae739/lib/utils.sh#L1
The README also says:
> By default asdf-ruby uses the latest release of ruby-build, but you can choose your own branch/tag through the ASDF_RUBY_BUILD_VERSION variable:
But this is misleading, asdf-ruby will often not use the latest release.
Unless maybe there is already some mechanism to auto-update ruby-build?
It would also avoid the need for many PRs like https://github.com/asdf-vm/asdf-ruby/pull/208
Some ideas:
* `ruby-build` `master` is fairly stable, it should be fine to just use that. This is what is recommended to update ruby-build in rbenv: https://github.com/rbenv/ruby-build#upgrading. Releases are mostly made IIRC for Homebrew.
* Find out the latest release using the GitHub API, i.e., the API equivalent of https://github.com/rbenv/ruby-build/releases/latest, and then I would think `asdf plugin update ruby` would be enough to get the latest release (it would always download the latest ruby-build release, unless it's already using it).
* Get some notification here or automated PR whenever there is a ruby-build release. Seems significantly more complicated but still a possible way.
Apologies if I missed something, I'm a ruby-build maintainer, and I am currently not using asdf, but would like to help keep the version of ruby-build in asdf-ruby always updated so users can get the latest Rubies/fixes.
Falco
(Falco)
4월 24, 2023, 1:38오전
3
제 추측으로는 @pfaffman 님이 asdf plugin update --all을 실행하는 것을 잊으신 것 같습니다.
pfaffman
(Jay Pfaffman)
4월 24, 2023, 6:14오후
4
Falco:
asdf plugin update --all
아니, 정말! 적어도 다음 명령어를 실행해 보려고 했다고 맹세하는데
asdf plugin update ruby
그런데 그것도 하지 않았던 것 같습니다.
하지만 이제 정말로 가까워졌습니다! 여기 Discourse를 가져오고, Ruby, imagemagick, nodejs를 업데이트하며, 데이터베이스를 마이그레이션하는 제 스크립트가 있습니다.
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)
asdf install ruby $RUBY_VERSION
asdf local ruby $RUBY_VERSION
IMAGE_MAGICK_VERSION=$(grep -e ^IMAGE_MAGICK_VERSION ~//src/discourse-repos/discourse_docker/image/base/install-imagemagick|cut -d'"' -f2)
asdf install imagemagick $IMAGE_MAGICK_VERSION
asdf local imagemagick $IMAGE_MAGICK_VERSION
# 2023-04-24 debian과 pop!os의 nodejs 버전이 다름
NODE_VERSION=$(docker run discourse/base:2.0.20230420-0104 bash -c 'node --version'|cut -d'v' -f2)
asdf install nodejs $NODE_VERSION
asdf local nodejs $NODE_VERSION
cd $DISCOURSE_SRC
git checkout main
git pull
bundle install
./bin/rake db:migrate
RAILS_ENV=test ./bin/rake db:migrate
redis와 postgres는 수동으로 최신 상태를 유지하는 것이 괜찮을 것 같지만, 다음에 OS를 설치했을 때 제 OS와 Discourse 버전이 달라져 있음을 발견하면 생각을 바꿀 가능성이 큽니다!
oxipng가 정확히 무엇인지 명확하지 않지만, 플러그인 개발자에게 잘못된 버전이 문제를 일으킬 가능성은 낮다고 생각합니다. jemalloc도 마찬가지입니다.
솔직히 말해서, imagemagick 버전 때문에 영향을 받을 플러그인 개발자가 얼마나 될지 저도 확신이 서지 않습니다. Ruby와 nodejs가 치명적인 문제(show stopper)를 일으킬 가능성이 높다고 생각합니다.
debian에 필요한 Ruby 버전이 제공되면 해당 스크립트가 사라질 것이라고 추측하지만, 이미 base 이미지에서 node 버전을 가져와야 한다는 사실을 알게 되었을 때 그 로직을 작성해 두었기 때문에, ruby와 imagemagick 버전도 이미지에서 가져오는 것이 더 안전할 수 있습니다.
@falco 님이 asdf plugin update --all로 제 문제를 해결해 준 시점과 이 스크립트를 작성한 시점 사이에 Ruby 버전이 3.2.2로 올라갔고, 제 코드가 이를 감지하여 asdf가 설치했습니다! 위 코드를 업데이트 스크립트에 추가했는데, 여기에는 다음이 포함되어 있습니다: