Unknown MySQL server host 'mysql.railway.internal'
nunommc
PROOP

a year ago

Hi,

I'm a little bit fed up already and soon I will give up.

I suggested a friend, to move his server to Railway (forgot to send the referral link by the way), and I've been trying for about 2 weeks to get a Dockerfile to work in a way so that the rails assets will be compiled. I didn't find a way to get that to work with Rails 5, because during build stage it would require connecting to the database, which is not supported.

So I changed approaches (temporarily, because the Dockerfile is the ideal solution), and deleted all Docker-related files and tried to get Nixpacks to deploy the app for me. It worked fine with the template, which uses Postgresql, but my app uses MySQL.

I keep getting this error below, which I believe it's because the private network is not available during build stage, but so, how can I get it to run the rails assets:precompile successfully? Some more documentation on this is appreciated.

Mysql2::Error::ConnectionError: Unknown MySQL server host 'mysql.railway.internal' (-2)

/usr/local/rvm/gems/2.7.8/gems/mysql2-0.5.6/lib/mysql2/client.rb:97:in connect' /usr/local/rvm/gems/2.7.8/gems/mysql2-0.5.6/lib/mysql2/client.rb:97:ininitialize'

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

0 Replies

Loading...