Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Command rails db:create doesn't work #24

Open
kihaya opened this issue Apr 30, 2021 · 3 comments
Open

Command rails db:create doesn't work #24

kihaya opened this issue Apr 30, 2021 · 3 comments

Comments

@kihaya
Copy link

kihaya commented Apr 30, 2021

Environment

  • Rails 6.1.3.1
  • MySQL 5.7

Issue

Rails command db:create doesn't work. After manually create db by DDL in MySQL console, I can correctly connect to the database in my Rails console.

$ bundle exec rails db:create
Rake tasks not supported by 'aurora_serverless' adapter
Couldn't create 'myapp_development' database. Please check your configuration.
rails aborted!
ActiveRecord::Tasks::DatabaseNotSupported: Rake tasks not supported by 'aurora_serverless' adapter
/myapp/bin/rails:5:in `<top (required)>'
/myapp/bin/spring:10:in `require'
/myapp/bin/spring:10:in `block in <top (required)>'
/myapp/bin/spring:7:in `<top (required)>'
Tasks: TOP => db:create
(See full trace by running task with --trace)
make: *** [create] Error 1
@metaskills
Copy link
Contributor

Correct. As far as I know this is impossible. Setting up an Aurora Serverless cluster in a production environment is out of scope for this gem. In fact, setting up a "production" DB for any ActiveRecord adapter is out of scope either. For development, you should use local MySQL server or one hosted in a Docker container.

@metaskills
Copy link
Contributor

metaskills commented May 2, 2021

Maybe I should update the README with something like this?

group :development, :test do
  gem 'mysql'
end

group :production do
  gem 'mysql2-lambda'
  gem 'activerecord-aurora-serverless-adapter'
end

@metaskills metaskills reopened this May 2, 2021
@kihaya
Copy link
Author

kihaya commented May 2, 2021

Maybe I should update the README with something like this?

group :development, :test do

  gem 'mysql'

end



group :production do

  gem 'mysql2-lambda'

  gem 'activerecord-aurora-serverless-adapter'

end

Sorry for my less information.
I use this stack for local Aurora Serverless data API emulation to connect from my Rails app througn Docker container.

https://koxudaxi.github.io/local-data-api/

Is it correct that db:create task is not available (or not yet implemented, hard to implement) for this moment for this gem ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants