6 months ago
Project ID: 4e951567-c8ef-4928-b6b6-89b3ed52cc02
I tried to build my Ruby on Rails project on this service a few weeks ago and it failed because even though I have a .ruby-version specifying 3.4.4, and even though I specified at one point Ruby 3.4.4 in the Gemfile, it tried and failed to build it with Ruby 3.2.x.
Eventually after I had given up someone replied and pointed me to a document that says you can set the RAILPACKRUBYVERSION variable. What they didn't say was the the same document says that it will, if that variable isn't found, use the one specified in the .ruby-version file and if that isn't there it will use the one in the Gemfile. Obviously I had already tried those last two things so either that document is wrong or there is something else that is wrong. Nevertheless the thread was marked as "solved".
I decided to give Railway another try and am back exactly where I was. I set the RAILPACKRUBYVERSION to 3.4.4 (though according to that document this shouldn't be necessary since I have a .ruby-version file) and it is still dying trying to build my app with Ruby 3.2.0.
It also failed to compile the Postgres extension.
The documentation makes it sounds like deploying a standard Rails application is basically as easy as connecting to Github. So why is this happening?
1 Replies
6 months ago
I'd recommend double-checking the RAILPACKRUBYVERSIONenvironment variable in your Railway project settings. This is the most direct way to enforce the Ruby version you're trying to use (3.4.4), and it can override the .ruby-version and Gemfile settings if they’re being ignored.