Rails 7 API only app deploy fails due to ruby version

I’m getting this error when trying to deploy a Rails 7 API only with React frontend monorepo.

I’ve specified the ruby version as mentioned in other posts like below.
In my .ruby-version I have 3.2.2
In my Gemfile I specify the ruby version with ruby File.read(‘.ruby-version’).strip

I have previously successfully deployed a rails app (not API only) that used ruby version 3 so I’m not sure what I’m missing with this one.



Are the Gemfile & .ruby-version in the root of your repo? If they’re not in the root, (e.g. in a monorepo setup), they won’t be detected. That’s where the Root Directory setting can help.


Thanks Alan!
Yes, on this project I had the rails app under a backend/ directory instead of the root directory. Doing as you said and setting “rootDir: backend” fixed the error.

Thanks again

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.