Closed J-Swift closed 1 month ago
I wasn't able to replicate this. But in any case, you should use the ruby File.read('.ruby-version')
syntax
Hmm the only other thing I can think of is that Im specifying the ruby version explicitly for nix (ruby = pkgs.ruby_3_2) instead of reading the file. That could be why its not in the store. Wont be back into the office until monday to check.
If it's not too much trouble, could you make a small reproducible example? Or maybe share the flake.nix here?
@inscapist will do. Hopefully sometime next week
@inscapist heres a basic repro off a rails new
: https://github.com/J-Swift/rubynix-repro
thank you. I will take a look tomorrow
@J-Swift the issue actually stems from the version of bundler being used. In the repro, your bundler version is 2.4.10 but the new syntax is only supported in 2.4.19 and above
https://github.com/rubygems/rubygems/releases/tag/bundler-v2.4.19
You could try switching to bobvanderlinden's nixpkgs-ruby and set your ruby version to 3.2.5. On ruby 3.2.5, the built-in bundler version is 2.4.19
This syntax is probably the new default for newer versions of rails. I am sure more people will be affected by this.
So thanks for the report!
Hmm weird. Good catch. Previously I was running via docker and other team members are running bare metal (no nix) so Ill have to figure out what bundler was being used before.
On Tue, Aug 27, 2024 at 10:42 AM Felx @.***> wrote:
This syntax is probably the new default for newer versions https://github.com/rails/rails/pull/49360 of rails. I am sure more people will be affected by this.
So thanks for the report!
— Reply to this email directly, view it on GitHub https://github.com/inscapist/ruby-nix/issues/44#issuecomment-2312763895, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFTHTTCKDO6YSPARDK2LX3ZTSF5PAVCNFSM6AAAAABNANVES2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSG43DGOBZGU . You are receiving this because you were mentioned.Message ID: @.***>
Also, thanks for this project. It greatly simplified moving to nix on rails. Id tried a few times before and never could get it working quite right so Ive been sticking to docker for rails. Now I get nix + bare metal performance… win+win!
I know what you mean, that's great to hear!
Maybe I'm not configuring something properly on my end, but it looks like providing ruby version in a Gemfile doesnt work.
e.g. if I do this in my Gemfile
if fails with
but if I do it explicitly
it works. I assume its because the version file isnt being copied to the store, but it also seems like it should still work at runtime since the version file exists? I added ruby-nix to an existing project that was working before, so its definitely configured properly at a basic level.
EDIT: it also turns out that this old-style of specifying the path also works