# Aiuto con asdf e bundle

**URL:** <https://meta.discourse.org/t/help-with-asdf-and-bundle/292287>\
**Category:** Development\
**Created:** [19 Gennaio 2024, 8:23pm UTC](https://meta.discourse.org/t/help-with-asdf-and-bundle/292287 "2024-01-19T20:23:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [19 Gennaio 2024, 8:23pm UTC](https://meta.discourse.org/t/help-with-asdf-and-bundle/292287/1 "2024-01-19T20:23:12Z")

</div>

Questo non è veramente un problema di Discourse, ma lo riscontro solo con Discourse. Ho cercato altrove senza successo, quindi sono qui ora.

Se eseguo `bundle install` in una directory discourse appena clonata, ottengo questo:

```plaintext
(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)

```

Se lo eseguo in una directory che contiene un plugin, funziona perfettamente. Tempo fa, giuro che ho clonato discourse e `bundle install` ha funzionato, ma poi ha smesso.

Ecco come ho configurato le cose per cercare di ottenere le versioni corrette delle cose. Penso che sia questo il problema in qualche modo. Per alcuni mesi, o forse un anno, questo ha funzionato per ottenere le versioni corrette delle cose dall’ultima immagine docker.

```plaintext
  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

```

---

_[View the full topic](https://meta.discourse.org/t/help-with-asdf-and-bundle/292287)._
