Railpack builder bug with mise-installed Ruby — /usr/local/bundle path mismatch

The Railpack builder generates a copy /usr/local/bundle step during image assembly, but when Ruby is installed via mise, gems are stored under the mise-managed Ruby path instead. This causes every build to fail.

Details:

  • Service: [redacted]
  • Failed deployment: [redacted]
  • Error:failed to calculate checksum of ref: '/usr/local/bundle': not found
  • Impact: Every deployment since switching from Nixpacks to Railpack has failed
  • Workaround: Reverting to Nixpacks builder restores builds

Reproduction:

  1. Use Railpack builder with Ruby installed via mise
  2. Run bundle install (succeeds with 283 gems)
  3. Build fails at image assembly when trying to copy /usr/local/bundle
$10 Bounty

3 Replies

Status changed to Awaiting Railway Response Railway about 1 month ago


Railway
BOT

a month ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open Railway about 1 month ago


irazvan2745
FREE

a month ago

Hey, i recommend using your own dockerfile


a month ago

I'd love to fix this up in Railpack. We have a bunch of examples in our test suite that use mise-managed ruby, so there must be some other detail that is missing.

Could you get me:

  1. tree or ls output of your main project dir. Goal is understanding what the file structure of the project is.
  2. If there's no sensitive information in your build log from Railway, that would be really helpful to take a look at.
  3. I'm assuming it's not an open source repo, but if it it (or if you can replicate it in a open repo) that would be super helpful to take a look at.

Update: we got this working.

The failure mode was Rails + vite_ruby + Bun on Railpack. The build appeared to hang with logs repeatedly showing:

- Rails application initialized successfully

- Building with Vite ️

…but it never reached the actual JS Vite output like:

- vite v5.x building for production

- transforming...

- modules transformed

- Build with Vite complete

The fix was to make the custom Railpack build step do three things explicitly:

1. Copy the app source into the build step.

2. Consume the Bun/Node install output from install:node.

3. Force vite_ruby to execute the real Vite binary from node_modules.

Example railpack.json build step:

"build": {

"inputs": [

"...",

{

"step": "install:node",

"include": ["/app/node_modules"]

}

],

"deployOutputs": [

{

"include": ["/app", "lib/"]

}

],

"commands": [

{ "src": ".", "dest": "." },

"VITE_RUBY_VITE_BIN_PATH=/app/node_modules/.bin/vite bin/vite build"

]

}

Before this, the custom build step could run bin/vite build without /app/node_modules being available in that step. In this setup, vite_ruby appeared to re-enter the Ruby bin/vite wrapper repeatedly instead of reaching the JS Vite executable.

After copying the app source, adding the install:node input, and setting VITE_RUBY_VITE_BIN_PATH, the build reached the real Vite output and completed successfully.

This may be worth documenting in Railpack for Rails apps using vite_ruby + Bun, or Railpack could warn when a custom build step runs Vite but does not include the Node install output.


Status changed to Open codydearkland 10 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...