Search code examples
ruby-on-railsactiverecordruby-on-rails-6rails-migrationsruby-on-rails-6.1

Rails 6 - db:migrate NameError: wrong constant name


I'm new to Rails and would like to add a table to my development database using rails migration script. Upon running rails db:migrate, I got the NameError: wrong constant name 2040[MyMigrationClassName].

I thought I used a reserved class name, so I changed the names in the migration script + the views, models, and converters associated with it, but same error.

Why is this happening? Thank you in advanced for your help.

Here's the error:

$ rails db:migrate 
rails aborted!
NameError: wrong constant name 2040CreateConverter
/home/ubuntu/MyApp/bin/rails:5:in `<top (required)>'
/home/ubuntu/MyApp/bin/spring:10:in `block in <top (required)>'
/home/ubuntu/Myapp/bin/spring:7:in `<top (required)>'

Caused by:
NameError: wrong constant name 2040CreateConverter
/home/ubuntu/MyApp/bin/rails:5:in `<top (required)>'
/home/ubuntu/MyApp/bin/spring:10:in `block in <top (required)>'
/home/ubuntu/MyApp/bin/spring:7:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Here's the migration script:

class CreateConverters < ActiveRecord::Migration[6.1]
  def change
    create_table :converters do |t|
      t.string :banks
      t.binary :files
      t.binary :results
      t.timestamps :created_at
    end
  end
end

I already have model Converter, controller ConverterController, and converter/*.html.erb views that will be associated with the table.

I use Rails 6.1.3, Ruby 3.0, and postgreSQL as database. I'm in Ubuntu 20.04 LTS.

Here's the detailed error trace:

$ rails db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
rails aborted!
NameError: wrong constant name 2040CreateConverter
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3/lib/active_support/inflector/methods.rb:274:in `const_get'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3/lib/active_support/inflector/methods.rb:274:in `constantize'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1046:in `load_migration'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1041:in `migration'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1037:in `disable_ddl_transaction'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1387:in `use_transaction?'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1334:in `rescue in execute_migration_in_transaction'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1322:in `execute_migration_in_transaction'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1302:in `each'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1251:in `block in migrate'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1251:in `migrate'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1086:in `up'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1061:in `migrate'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <main>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/railties/databases.rake:90:in `each'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <main>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `block in execute'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `each'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `execute'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `synchronize'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:188:in `invoke'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:160:in `invoke_task'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `each'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block in top_level'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:125:in `run_with_threads'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:110:in `top_level'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:186:in `standard_exception_handling'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/rake_module.rb:59:in `with_application'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/command.rb:52:in `invoke'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/commands.rb:18:in `<main>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/ubuntu/MyApp/bin/rails:5:in `<top (required)>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
<internal:/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/home/ubuntu/MyApp/bin/spring:10:in `block in <top (required)>'
<internal:kernel>:90:in `tap'
/home/ubuntu/MyApp/bin/spring:7:in `<top (required)>'
bin/rails:2:in `load'
bin/rails:2:in `<main>'

Caused by:
NameError: wrong constant name 2040CreateConverter
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3/lib/active_support/inflector/methods.rb:274:in `const_get'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3/lib/active_support/inflector/methods.rb:274:in `constantize'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1046:in `load_migration'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1041:in `migration'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1037:in `disable_ddl_transaction'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1387:in `use_transaction?'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1379:in `ddl_transaction'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1302:in `each'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1251:in `block in migrate'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1251:in `migrate'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1086:in `up'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/migration.rb:1061:in `migrate'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <main>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/railties/databases.rake:90:in `each'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.3/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <main>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `block in execute'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `each'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `execute'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `synchronize'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:188:in `invoke'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:160:in `invoke_task'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `each'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block in top_level'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:125:in `run_with_threads'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:110:in `top_level'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:186:in `standard_exception_handling'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/rake_module.rb:59:in `with_application'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/command.rb:52:in `invoke'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3/lib/rails/commands.rb:18:in `<main>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/ubuntu/MyApp/bin/rails:5:in `<top (required)>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
<internal:/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/home/ubuntu/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/home/ubuntu/MyApp/bin/spring:10:in `block in <top (required)>'
<internal:kernel>:90:in `tap'
/home/ubuntu/MyApp/bin/spring:7:in `<top (required)>'
bin/rails:2:in `load'
bin/rails:2:in `<main>'
Tasks: TOP => db:migrate


Solution

  • Turns out the migration file name db/migrate/20210312_2040_create_converter.rb was erroneous.

    The underscore in between the timestamp that was put for readability ended up messing the constant name by appending numbers, hence the Name Error: wrong constant name.

    I also:

    • pluralized the filename since after removing the underscore, I got another error that asked for the pluralization
    • removed the argument :created at after t.timestamps.

    In the end, the file name became db/migrate/202103122040_create_converters.rband the migration ran smoothly.