-
Notifications
You must be signed in to change notification settings - Fork 561
can't run migrations with external databases #1513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's trying to connect to a local Postgres DB - maybe RAILS_ENV is not set correctly? Does this work? RAILS_ENV=production bundle exec rails db:migrate |
RAILS_ENV is set correctly. As I mentioned, when I enter the Rails console, I can access ActiveRecord, but when I run the' rails db: migrate' command, I encounter an issue. |
Try prefixing your commands with dotenv, I had a similar issue and this solved it.
|
@jorgefgiron thanks but that does not work for me as I do not use .env file look this example: ENTER CONSOLE:
EXEC DB: COMMAND FAILS 🔴
### GET THE ENV ✅
## ENTER CONSOLE rails@07c79c748b0f:/rails$ bundle exec rails c
|
Hello, I have my Kamal deployment up and running on the server, but I'm having trouble running migrations or preparing the app.
I am using an external database hosted on a managed server with Digital Ocean, and I have the following configuration set up:
The issue I'm facing is that the app seems to attempt connecting to a local database when I run the commands
rails db:migrate
orrails db:prepare
. However, the server operates normally. I can also access the Rails console without any problems. When I enter the console using bash and runrails c
, everything works fine. Yet, when I executerails db:migrate
, I encounter an issue with the server.THIS ON THE SAME SSH SESSION
Super weird, what could be happening here?
The text was updated successfully, but these errors were encountered: