problem with migrating database on heroku - ruby-on-rails

I got an error when migrating my database on heroku for my new rails app
here's the error I got
rails aborted!
Gem::LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile.
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/rubygems_integration.rb:377:in `block (2 levels) in replace_gem'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:12:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/connection_specification.rb:191:in `spec'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:950:in `establish_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_handling.rb:60:in `establish_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/railtie.rb:136:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/base.rb:328:in `<module:ActiveRecord>'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/base.rb:27:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/app/models/shop.rb:1:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:374:in `block in require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:13:in `loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:37:in `load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:352:in `require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:506:in `load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `block in load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:57:in `load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:193:in `const_missing'
/app/config/initializers/shopify_app.rb:9:in `block in <main>'
/app/vendor/bundle/ruby/2.5.0/gems/shopify_app-8.3.2/lib/shopify_app/configuration.rb:71:in `configure'
/app/config/initializers/shopify_app.rb:1:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `block in load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:657:in `block in load_config_initializer'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:656:in `load_config_initializer'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:613:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:613:in `block in <class:Engine>'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:361:in `initialize!'
/app/config/environment.rb:7:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:337:in `require_environment!'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/command.rb:48:in `invoke'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/bin/rails:11:in `<main>'
Caused by:
Gem::LoadError: sqlite3 is not part of the bundle. Add it to your Gemfile.
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/rubygems_integration.rb:377:in `block (2 levels) in replace_gem'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:12:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/connection_specification.rb:191:in `spec'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:950:in `establish_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_handling.rb:60:in `establish_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/railtie.rb:136:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/base.rb:328:in `<module:ActiveRecord>'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/base.rb:27:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/app/models/shop.rb:1:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:374:in `block in require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:13:in `loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:37:in `load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:352:in `require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:506:in `load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `block in load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:57:in `load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:193:in `const_missing'
/app/config/initializers/shopify_app.rb:9:in `block in <main>'
/app/vendor/bundle/ruby/2.5.0/gems/shopify_app-8.3.2/lib/shopify_app/configuration.rb:71:in `configure'
/app/config/initializers/shopify_app.rb:1:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `block in load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:657:in `block in load_config_initializer'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:656:in `load_config_initializer'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:613:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:613:in `block in <class:Engine>'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:361:in `initialize!'
/app/config/environment.rb:7:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:337:in `require_environment!'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/command.rb:48:in `invoke'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<main>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/app/bin/rails:11:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
knowing that I'm still beginner with Rails, and to get sqlite3 work with heroku I have to move it inside of development and test group inside my gemfile.
and here's my gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
# Rails Engine for building Shopify Apps.
gem 'shopify_app'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.1'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
group :production do
gem 'pg'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
knowing that I'm still beginner with Rails, and to get sqlite3 work with heroku I have to move it inside of development and test group inside my gemfile.

It happened to me when i started with heroku and rails. I think the problem is that you deployed your app before putting the pg gem in production group and now for some reason even if added the gem you still having the problem.
Possible solution:
Delete your Gemfile.lock and run
bundle install --without=production
Delete the app you deployed on heroku and deploy a new one with the new gemfile.lock.
My solution:
I deleted my rails app and created new one, it wasn't a problem since i was just starting the project but i learned that you have to configure your gemfile and your app in general before starting to code and deploy, this is the correct way to go.
Check the first chapter from this tutorial for a correct configuration before deploying to heroku: https://www.railstutorial.org

You need to add pg gem for production. set heroku environment to production. sqlite3 is not supported by heroku.

Related

How to fix the 'mysql2' error when loading rails console?

I'm trying to start up the rails console ( not related to my previous questions since these are different errors ) and I can't, for the life of me, figure out how to fix this or what's even asking me to do. I'm running: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux].
I type in the rails console command and get the following:
ubuntu:~/environment/sample_app (sign-up) $ rails console
/home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem': Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? mysql2 is not part of the bundle. Add it to your Gemfile. (LoadError)
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/connection_specification.rb:169:in `spec'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1052:in `establish_connection'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_handling.rb:51:in `establish_connection'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/railtie.rb:201:in `block (2 levels) in <class:Railtie>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/base.rb:327:in `<module:ActiveRecord>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/base.rb:27:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:370:in `active_record_configured?'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:287:in `disconnect_database'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:111:in `preload'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
ubuntu:~/environment/sample_app (sign-up) $ rails console
/home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem': Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? mysql2 is not part of the bundle. Add it to your Gemfile. (LoadError)
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/connection_specification.rb:169:in `spec'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1052:in `establish_connection'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_handling.rb:51:in `establish_connection'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/railtie.rb:201:in `block (2 levels) in <class:Railtie>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/base.rb:327:in `<module:ActiveRecord>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/base.rb:27:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:370:in `active_record_configured?'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:287:in `disconnect_database'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:111:in `preload'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
UPDATE
this is what my gemfile looks like currently.
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rails', '6.0.3.1'
gem 'mysql2', '~> 0.3.20'
gem 'image_processing', '1.9.3'
gem 'mini_magick', '4.9.5'
gem 'active_storage_validations', '0.8.9'
gem 'bcrypt', '3.1.13'
gem 'faker', '2.11.0'
gem 'will_paginate', '3.3.0'
gem 'bootstrap-will_paginate', '1.0.0'
gem 'bootstrap-sass', '3.4.1'
gem 'puma', '4.3.5'
gem 'sass-rails', '6.0.0'
gem 'webpacker', '4.2.2'
gem 'turbolinks', '5.2.1'
gem 'jbuilder', '2.10.0'
gem 'bootsnap', '1.4.6', require: false
group :development, :test do
gem 'sqlite3', '1.4.2'
gem 'byebug', '11.1.3', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '4.0.2'
gem 'listen', '3.2.1'
gem 'spring', '2.1.0'
gem 'spring-watcher-listen', '2.0.1'
end
group :test do
gem 'capybara', '3.32.2'
gem 'selenium-webdriver', '3.142.7'
gem 'webdrivers', '4.3.0'
gem 'rails-controller-testing', '1.0.4'
gem 'minitest', '5.11.3'
gem 'minitest-reporters', '1.3.8'
gem 'guard', '2.16.2'
gem 'guard-minitest', '2.4.6'
end
group :production do
gem 'pg', '1.2.3'
gem 'aws-sdk-s3', '1.46.0', require: false
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# Uncomment the following line if you're running Rails
# on a native Windows system:
# gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
I tried the suggestions given, but now my error looks like this when I try to run 'rails console'. Bundle install works fine.
ubuntu:~/environment/sample_app (sign-up) $ rails console
/home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem': Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? can't activate mysql2 (>= 0.4.4), already activated mysql2-0.3.21. Make sure all dependencies are added to Gemfile. (LoadError)
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/connection_specification.rb:169:in `spec'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1052:in `establish_connection'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/connection_handling.rb:51:in `establish_connection'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/railtie.rb:201:in `block (2 levels) in <class:Railtie>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/base.rb:327:in `<module:ActiveRecord>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3.1/lib/active_record/base.rb:27:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:370:in `active_record_configured?'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:287:in `disconnect_database'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:111:in `preload'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Ensure ‘mysql2’ is included in your gem file and run bundle install
The key part of the error message is:
Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? mysql2 is not part of the bundle. Add it to your Gemfile.

`initialize': uninitialized constant ActionCable::Server::Configuration::ApplicationCable

I have upgraded my rails project from 4.x to 5.0.0.beta1 for use the actioncable and I have followed the example of DHH but it is not working. When I start the rails server it shows error:
$ rails s
=> Booting Puma
=> Rails 5.0.0.beta1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/configuration.rb:15:in `initialize': uninitialized constant ActionCable::Server::Configuration::ApplicationCable (NameError)
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:16:in `new'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:16:in `block in <class:Base>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/attribute_accessors.rb:72:in `block in mattr_reader'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/attribute_accessors.rb:55:in `each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/attribute_accessors.rb:55:in `mattr_reader'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/attribute_accessors.rb:208:in `mattr_accessor'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:16:in `<class:Base>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:12:in `<module:Server>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:7:in `<module:ActionCable>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:6:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable.rb:43:in `server'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config/routes.rb:28:in `block in <top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_dispatch/routing/route_set.rb:380:in `instance_exec'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_dispatch/routing/route_set.rb:380:in `eval_block'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_dispatch/routing/route_set.rb:362:in `draw'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config/routes.rb:1:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/initializable.rb:30:in `run'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application.rb:350:in `initialize!'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config/environment.rb:5:in `<top (required)>'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config.ru:3:in `require'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config.ru:3:in `block in <main>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:55:in `instance_eval'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:55:in `initialize'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config.ru:in `new'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config.ru:in `<main>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:49:in `eval'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:49:in `new_from_string'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:40:in `parse_file'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:218:in `app'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/server.rb:56:in `app'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:353:in `wrapped_app'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/server.rb:134:in `log_to_stdout'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/server.rb:74:in `start'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/command.rb:20:in `run'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands.rb:19:in `<top (required)>'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/bin/rails:8:in `require'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/bin/rails:8:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
This is my Gemfile :
gem 'bcrypt'
gem 'faker'
gem 'carrierwave'
gem 'mini_magick'
gem 'fog'
# gem 'haml-rails'
gem 'sqlite3'
gem 'active_model_serializers', '~> 0.10.0.rc1'
gem 'sprockets'
gem 'sprockets-rails'
gem 'bourbon'
gem 'neat'
gem 'bitters'
gem 'bunny'
gem 'activesupport', '5.0.0.beta1'
gem 'actionpack'
gem 'arel'
gem 'rack'
gem 'puma', '2.15.3'
gem 'actioncable' , '5.0.0.beta1'
gem 'will_paginate'
gem 'bootstrap-will_paginate'
gem 'bootstrap-sass'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'
gem 'sdoc'
You need to add require 'action_cable/engine' to your config/application.rb.
The error is related to not having the correct ActionCable files in your project. You need app/channels/application_cable/channel.rb that looks like this:
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
and
# app/channels/application_cable/connection.rb
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
Add require "action_cable" in config/application.rb
Source:
https://github.com/rails/rails/issues/23183

Rails server returning error with Gemfile

When I run my rails server on Terminal, I get the following message:
Exiting
/Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `devise' for Install (call 'Install.connection' to establish a connection):Class (NoMethodError)
from /Users/Rushal-Marketing/Desktop/pinter/app/models/install.rb:4:in `<class:Install>'
from /Users/Rushal-Marketing/Desktop/pinter/app/models/install.rb:1:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `block in load_file'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:456:in `load_file'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:354:in `require_or_load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:494:in `load_missing_constant'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:184:in `const_missing'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:261:in `const_get'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:261:in `block in constantize'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in `each'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in `inject'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in `constantize'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:566:in `get'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:597:in `constantize'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise.rb:291:in `get'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:81:in `to'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:76:in `modules'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:93:in `routes'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:160:in `default_used_route'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:70:in `initialize'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise.rb:325:in `new'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise.rb:325:in `add_mapping'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/rails/routes.rb:238:in `block in devise_for'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/rails/routes.rb:237:in `each'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/rails/routes.rb:237:in `devise_for'
from /Users/Rushal-Marketing/Desktop/pinter/config/routes.rb:4:in `block in <top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:434:in `instance_exec'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:434:in `eval_block'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:412:in `draw'
from /Users/Rushal-Marketing/Desktop/pinter/config/routes.rb:1:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/file_update_checker.rb:75:in `call'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/file_update_checker.rb:75:in `execute'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
from /Users/Rushal-Marketing/Desktop/pinter/config/environment.rb:5:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /Users/Rushal-Marketing/Desktop/pinter/config.ru:3:in `block in <main>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /Users/Rushal-Marketing/Desktop/pinter/config.ru:in `new'
from /Users/Rushal-Marketing/Desktop/pinter/config.ru:in `<main>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:61:in `app'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:78:in `start'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/Rushal-Marketing/Desktop/pinter/bin/rails:9:in `require'
from /Users/Rushal-Marketing/Desktop/pinter/bin/rails:9:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/client/rails.rb:28:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/client/rails.rb:28:in `call'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/client/command.rb:7:in `call'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/client.rb:28:in `run'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/bin/spring:51:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/binstub.rb:11:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Rushal-Marketing/Desktop/pinter/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Here is my Gemfile:
source 'https://rubygems.org'
ruby '2.2.1'
gem 'rails', '~> 4.2.5'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'devise', '~> 3.5.3'
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
gem 'bootstrap-sass'
Any assistance with this would be much appreciated! Thanks!
You need to run the command
rails generate devise:install
You need to do it in your console
bundle install
Then
bundle exec rails generate devise:install
bundle exec rails generate device model_name
in your case model_name might be Install
First you have to bundle your gems:
bundle install
Then you have to install devise:
rails g devise:install
And then you have to restart the rails server:
Ctrl + C
$ rails s

Error when starting my rails server: Circular dependency detected while autoloading constant AdminUser (RuntimeError)

I have this problem, which is when i try to start to start the rails server i get this:
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:492:in `load_missing_constant': Circular dependency detected while autoloading constant AdminUser (RuntimeError)
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:184:in `const_missing'
from /Users/ludvigsorensen/Desktop/BackyardCoding/app/admin/admin_user.rb:1:in `<top (required)>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:457:in `load'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:457:in `block in load_file'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:456:in `load_file'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:354:in `require_or_load'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:494:in `load_missing_constant'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:184:in `const_missing'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:261:in `const_get'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:261:in `block in constantize'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:259:in `each'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:259:in `inject'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:259:in `constantize'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:566:in `get'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:597:in `constantize'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise.rb:302:in `get'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise/mapping.rb:80:in `to'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise/mapping.rb:75:in `modules'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise/mapping.rb:92:in `routes'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise/mapping.rb:159:in `default_used_route'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise/mapping.rb:69:in `initialize'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise.rb:336:in `new'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise.rb:336:in `add_mapping'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:224:in `block in devise_for'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:223:in `each'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:223:in `devise_for'
from /Users/ludvigsorensen/Desktop/BackyardCoding/config/routes.rb:3:in `block in <top (required)>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:423:in `instance_exec'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:423:in `eval_block'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:401:in `draw'
from /Users/ludvigsorensen/Desktop/BackyardCoding/config/routes.rb:1:in `<top (required)>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/file_update_checker.rb:75:in `call'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/file_update_checker.rb:75:in `execute'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
from /Users/ludvigsorensen/Desktop/backyardcoding/config/environment.rb:5:in `<top (required)>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /Users/ludvigsorensen/Desktop/backyardcoding/config.ru:3:in `block in <main>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /Users/ludvigsorensen/Desktop/backyardcoding/config.ru:in `new'
from /Users/ludvigsorensen/Desktop/backyardcoding/config.ru:in `<main>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:61:in `app'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:78:in `start'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/ludvigsorensen/Desktop/BackyardCoding/bin/rails:8:in `require'
from /Users/ludvigsorensen/Desktop/BackyardCoding/bin/rails:8:in `<top (required)>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.4.0/lib/spring/client/rails.rb:28:in `load'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.4.0/lib/spring/client/rails.rb:28:in `call'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.4.0/lib/spring/client/command.rb:7:in `call'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.4.0/lib/spring/client.rb:28:in `run'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.4.0/bin/spring:49:in `<top (required)>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.4.0/lib/spring/binstub.rb:11:in `load'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.4.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/ludvigsorensen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/ludvigsorensen/Desktop/backyardcoding/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I think this might be related to active_admin btw here is my gem file.....
source 'https://rubygems.org'
gem 'bootstrap-sass', '~> 3.3.5.1'
gem 'devise', '~> 3.4.1'
gem 'toastr-rails'
gem 'activeadmin', github: 'activeadmin'
gem 'paperclip', '~> 4.2.1'
gem 'friendly_id', '~> 5.1.0'
gem 'active_admin-sortable_tree', '~> 0.2.1'
gem 'kaminari', '~> 0.16.3'
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
gem 'mandrill-api', '1.0.52', require: 'mandrill'
gem 'redcarpet', '~> 3.2.3'
gem 'coderay', '~> 1.1.0'
gem 'rails', '4.2.0'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
end
Do you know what i should do?
So i just fixed it myself. This answer helped me out: https://github.com/activeadmin/activeadmin/issues/2334#issuecomment-42626409
I just had to rename my models inside the app/admin directory to plural, fx with admin_user.rb. I renamed app/admin/admin_user.rb to app/admin/admin_users.rb, and then renamed the other files to plural as well.

undefined method `has_attached_file' : Paperclip error with ActiveAdmin and cucumber

I have installed ActiveAdmin(1.0.0.pre1), Paperclip(4.2.1) and Cucumber(1.4.2).
I am facing strange issue in my system when I do testing with cucumber.
I have a model with paperclip configuration and has method has_attached_file. However everything is working well, but I do testing with cucumber it raises error regarding active admin resource of that model.
Here is full error stack :
undefined method `has_attached_file' for Document (call 'Document.connection' to establish a connection):Class (NoMethodError)
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/home/anand/rails_workspace_20_1_2015/MyApp/app/models/document.rb:7:in `<class:Document>'
/home/anand/rails_workspace_20_1_2015/MyApp/app/models/document.rb:2:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:360:in `require_or_load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:494:in `load_missing_constant'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:184:in `const_missing'
/home/anand/rails_workspace_20_1_2015/MyApp/app/admin/document.rb:2:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:197:in `block in load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/error.rb:41:in `capture'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:197:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:189:in `block in load!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:189:in `each'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:189:in `load!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:211:in `routes'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin.rb:79:in `routes'
/home/anand/rails_workspace_20_1_2015/MyApp/config/routes.rb:2:in `block in <top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:432:in `instance_exec'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:432:in `eval_block'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:410:in `draw'
/home/anand/rails_workspace_20_1_2015/MyApp/config/routes.rb:1:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `each'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:16:in `reload!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/file_update_checker.rb:75:in `call'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/file_update_checker.rb:75:in `execute'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:27:in `updater'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:427:in `each_strongly_connected_component_from'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:345:in `each'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:345:in `call'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:205:in `tsort_each'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-rails-1.4.2/lib/cucumber/rails/application.rb:15:in `initialize!'
/home/anand/rails_workspace_20_1_2015/MyApp/config/environment.rb:5:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-rails-1.4.2/lib/cucumber/rails.rb:7:in `require'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-rails-1.4.2/lib/cucumber/rails.rb:7:in `<top (required)>'
/home/anand/rails_workspace_20_1_2015/MyApp/features/support/env.rb:8:in `require'
/home/anand/rails_workspace_20_1_2015/MyApp/features/support/env.rb:8:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/rb_support/rb_language.rb:95:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/rb_support/rb_language.rb:95:in `load_code_file'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:180:in `load_file'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:82:in `each'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime.rb:184:in `load_step_definitions'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime.rb:42:in `run!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/cli/main.rb:47:in `execute!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/bin/cucumber:13:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bin/cucumber:23:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bin/cucumber:23:in `<main>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bin/ruby_executable_hooks:15:in `eval'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bin/ruby_executable_hooks:15:in `<main>'
Gemfile :
source 'https://rubygems.org'
gem 'devise'
gem 'mysql2'
gem 'cancancan'
gem 'activeadmin' , github: "activeadmin"
gem 'paperclip'
gem 'paper_trail'
gem 'rails', '4.2.1'
gem 'jquery-rails'
group :development, :test do
gem 'byebug'
gem 'pry-byebug'
gem 'pry-stack_explorer'
gem 'pry-rails'
gem 'pry-doc'
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'factory_girl_rails'
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails', require: false
gem 'rspec-rails'
end
Model :
class Document < ActiveRecord::Base
belongs_to :user
has_paper_trail
has_attached_file :doc, :default_url => "/images/:style/missing.png"
validates_attachment :doc, content_type: {:content_type => ["application/pdf", /\Aimage\/.*\Z/ ] }
end
ActiveAdmin resource :
ActiveAdmin.register_page "Document" do
end
What is the reason to getting this problem ? I have tried searching all the resource from google and may other way to trace it. And finally I have posted here. Need suggestion. Thank you.
After checking all files and experiments, I finally found the solution. The problem was paperclip.rb file in Rails.root/lib folder. The file contains no content but it creates problem while I was running cucumber. So I deleted that file and all works. Let's hope this helps to other :-)

Resources