Ruby on Rails development issue in Toolbox | workaround

Hi,

I’m a Ruby on Rails developer and I switched from Workstation to Silverblue 2 weeks ago.

I installed rbenv and ruby from a Toolbox container.I installed the gems with Bundler started the ruby on rails server. But I noticed something wrong with migrations rails db:migrate on an application relying on Redmine.

Mysteriously, migrations started fine but stopped everytime at the 37 - in Redmine, migrations are incremental and not timestamped. No way to pass the 38 and higher.
I found the issue on Stackoverflow ruby - Rails rake db:migrate doesn't work: nothing happens - Stack Overflow after have been struggling many hours . It’s an issue known by Toolbox: VERSION environment variable set can cause troubles · Issue #261 · containers/toolbox · GitHub

The cause was the VERSION environment variable set by the Toolbox/Podman image. I use the image of Fedora Workstation 37 in Toolbox(then VERSION is set to 37). Then when I enter in the container VERSION was initialized to 37. This same environment variable is used by the tool db:migrate.

To fix this issue, I put unset VERSION in my ~/.zshrc

Maybe, it can help someone…

5 Likes

What happens if you try running with VERSION=38 rails db:migrate ? That should override that variable for this specific command without overriding it for others in the shell session.

Hi Scott,

it doesn’t solve the problem. This command will stop the migration at 38 and wont’t trigger the following (39, 40, …) Then a poor and tiedious workaround is to set VERSION for each migration file,

But do we have to worry about Fedora VERSION variable in Toolbox ? Is it really important to keep it safe ? Is there an use case where we need it ?