https://railway.app/install.sh not working
eric2024
PROOP

23 days ago

I have a dotnet project that is deployed from Gitlab based on the yaml script I got from the Railway blog a long time ago. This yaml script has been working for months, but today deployments are failing because the install.sh script isn't working.

Was this install.sh script changed recently?

This is the output from the build job on Gitlab:


[...previous lines truncated...]

Setting up curl (7.88.1-10+deb12u14) ...

Setting up libcurl4-openssl-dev:amd64 (7.88.1-10+deb12u14) ...

Processing triggers for libc-bin (2.36-9+deb12u10) ...

$ curl -fsSL https://railway.app/install.sh | sh

Installing railway, please wait…

✓ railway was installed successfully to ~/.railway/bin/railway

sh: 141: Bad substitution

Cleaning up project directory and file based variables 00:01

ERROR: Job failed: exit code 1


Solved$20 Bounty

Pinned Solution

The install script was updated 2 weeks ago. See: https://github.com/railwayapp/cli/pull/888/changes.

Based on the docs in the github page, you should use this command to install the railway cli: bash <(curl -fsSL railway.com/install.sh) -y.

Or you could bypass that entirely and install it using npm for example: npm i -g @railway/cli

You can read more about this here: https://github.com/railwayapp/cli#installation

2 Replies

Status changed to Open Railway 23 days ago


The install script was updated 2 weeks ago. See: https://github.com/railwayapp/cli/pull/888/changes.

Based on the docs in the github page, you should use this command to install the railway cli: bash <(curl -fsSL railway.com/install.sh) -y.

Or you could bypass that entirely and install it using npm for example: npm i -g @railway/cli

You can read more about this here: https://github.com/railwayapp/cli#installation


vijaytallolli12
FREE

23 days ago

I believe the issue is caused by the shell being used to run the Railway install script.

Currently the pipeline uses:

curl -fsSL https://railway.app/install.sh | sh

But the newer Railway install script appears to contain Bash-specific syntax, which sh (Dash on Debian/Ubuntu runners) cannot handle, resulting in:

sh: 141: Bad substitution

The installation itself succeeds, but the script fails afterward because of shell compatibility.

Changing the command to use bash instead of sh fixes the issue:

curl -fsSL https://railway.app/install.sh | bash

You may also need to ensure Bash is installed in the GitLab runner image:

before_script:
  - apt-get update && apt-get install -y curl bash
  - curl -fsSL https://railway.app/install.sh | bash

This is likely why it worked previously and suddenly started failing — either the Railway install script was updated with Bash syntax or the runner environment changed.


Status changed to Solved chandrika 23 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...