NoMethodError: undefined method `configure' for AjaxDatatablesRails:Module - ruby-on-rails

When I execute rake db:create command it will display some error's
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
NoMethodError: undefined method `configure' for AjaxDatatablesRails:Module
/home/jsmani/project-folder/config/initializers/ajax_datatables_rails.rb:3:in `<top (required)>'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.7.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:60:in `load'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.7.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:60:in `load'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:285:in `block in load'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:285:in `load'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/engine.rb:663:in `block in load_config_initializer'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.6/lib/active_support/notifications.rb:170:in `instrument'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/engine.rb:662:in `load_config_initializer'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/engine.rb:619:in `each'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/engine.rb:619:in `block in <class:Engine>'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/initializable.rb:32:in `instance_exec'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/initializable.rb:32:in `run'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/initializable.rb:61:in `block in run_initializers'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/initializable.rb:50:in `each'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/initializable.rb:50:in `tsort_each_child'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/initializable.rb:60:in `run_initializers'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/application.rb:361:in `initialize!'
/home/jsmani/project-folder/config/environment.rb:6:in `<top (required)>'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.7.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.7.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.7.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.7.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.7.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/skylight-5.1.0/lib/skylight/probes.rb:167:in `require'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in `block in require'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in `require'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/application.rb:337:in `require_environment!'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/railties-5.2.6/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/home/jsmani/.rvm/gems/ruby-2.5.3/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/home/jsmani/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
/home/jsmani/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => db:create => db:load_config => environment
(See full trace by running task with --trace)

In gemfile give some specific version for AjaxDataTablesRails like (gem 'ajax-datatables-rails', '~> 1.0.0') instead of giving (gem 'ajax-datatables-rails') like this.
After save this changes let execute this command (bundle install) on your terminal .
And now you execute rake db:create command .
and do following command rake db:migrate then start your server rails s

Related

rake aborted when i do rake db:setup

when i do rake db:setup the rake it's aborted and i don't know why...................... because postgresql is running this is the output of postgreql
fabian#Inna-marley:~$ sudo su - postgres
[sudo] contraseña para fabian:
postgres#Inna-marley:~$ psql
psql (13.0 (Ubuntu 13.0-1.pgdg20.04+1))
Digite «help» para obtener ayuda.
postgres=#
this is the output on my terminar
rake db:setup
rake aborted!
ArgumentError: Write key must be initialized
/home/fabian/.rvm/gems/ruby-2.6.6/gems/analytics-ruby-2.0.13/lib/segment/analytics/client.rb:319:in `check_write_key!'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/analytics-ruby-2.0.13/lib/segment/analytics/client.rb:28:in `initialize'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/analytics-ruby-2.0.13/lib/segment/analytics.rb:14:in `new'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/analytics-ruby-2.0.13/lib/segment/analytics.rb:14:in `initialize'
/home/fabian/rails-backend/config/initializers/analytics_ruby.rb:3:in `new'
/home/fabian/rails-backend/config/initializers/analytics_ruby.rb:3:in `<main>'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:285:in `block in load'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:285:in `load'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/engine.rb:657:in `block in load_config_initializer'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.2.1/lib/active_support/notifications.rb:170:in `instrument'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/engine.rb:656:in `load_config_initializer'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/engine.rb:613:in `each'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/engine.rb:613:in `block in <class:Engine>'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `run'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/initializable.rb:50:in `each'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/application.rb:361:in `initialize!'
/home/fabian/rails-backend/config/environment.rb:5:in `<main>'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/application.rb:337:in `require_environment!'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/railties-5.2.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/bugsnag-6.18.0/lib/bugsnag/integrations/rake.rb:20:in `execute'
/home/fabian/.rvm/gems/ruby-2.6.6/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/home/fabian/.rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:24:in `eval'
/home/fabian/.rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create => db:load_config => environment
(See full trace by running task with --trace)
I'd recommend to start with checking ENV variables, first of all in database.yml.

'rake db:migrate:up VERSION=' aborts

I created a migration. I am trying to run it by:
rake db:migrate:up VERSION=
It raises the following error:
D, [2018-06-03T13:20:41.295098 #2257] DEBUG -- : ** [Raven] Sending event 2a32cb0c249acd2efde26ce6453a2d77 to Sentry
D, [2018-06-03T13:20:41.343397 #2257] DEBUG -- : ** [Raven] Raven HTTP Transport connecting to https://app.getsentry.com
rake aborted!
NoMethodError: undefined method `last_comment' for #<Rake::Application:0x007fb71d8a76a0>
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.4/lib/rspec/core/rake_task.rb:101:in `define'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.4/lib/rspec/core/rake_task.rb:78:in `initialize'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-rails-3.0.2/lib/rspec/rails/tasks/rspec.rake:11:in `new'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-rails-3.0.2/lib/rspec/rails/tasks/rspec.rake:11:in `<top (required)>'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-rails-3.0.2/lib/rspec-rails.rb:13:in `block in <class:Railtie>'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/railtie.rb:237:in `instance_exec'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/railtie.rb:237:in `block in run_tasks_blocks'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/railtie.rb:245:in `each'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/railtie.rb:245:in `each_registered_block'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/railtie.rb:237:in `run_tasks_blocks'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:437:in `block in run_tasks_blocks'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/engine/railties.rb:13:in `each'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/engine/railties.rb:13:in `each'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:437:in `run_tasks_blocks'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:453:in `load_tasks'
/Rakefile:6:in `<top (required)>'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/rake_module.rb:29:in `load'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/application.rb:703:in `raw_load_rakefile'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/application.rb:104:in `block in load_rakefile'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/application.rb:103:in `load_rakefile'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/application.rb:82:in `block in run'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/.rbenv/versions/2.1.2/bin/rake:23:in `load'
/.rbenv/versions/2.1.2/bin/rake:23:in `<main>'
How can I deal with it?
Specify version when migrating. This is good is you want to migrate only specific version of your migration. If you want to migrate all pending migration you can just say rake db:migrate.
Example:
rake db:migrate:up VERSION=20120820165642
I had to run the command against local rails
rake db:migrate:up VERSION=20120820165642 RAILS_ENV=test
works for me

c9 and heroku / rake aborted! undefined method `mount'

Everything working fine on the development environment(C9). However, when it comes to deploying to Heroku, when I try to run 'heroku rake db:migrate', I get the following error message:
breadeat:~/workspace/KNU_Community_Sy_part (master) $ heroku run rake db:migrate
Running rake db:migrate on ⬢ arcane-woodland-11170... up, run.6105 (Free)
rake aborted!
NoMethodError: undefined method `mount' for #<Kcm::Application:0x00000002c99d00>
/app/config/environments/production.rb:2:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/railtie.rb:211:in `instance_eval'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/railtie.rb:211:in `configure'
/app/config/environments/production.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:600:in `block (2 levels) in <class:Engine>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:599:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:599:in `block in <class:Engine>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:59:in `block in run_initializers'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:48:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:48:in `tsort_each_child'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:58:in `run_initializers'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/application.rb:353:in `initialize!'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/application.rb:329:in `require_environment!'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.2/lib/rails/application.rb:445:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
help plz..
my code in github
link_to : https://github.com/sangyeol-kim/KNU_Community_Sy_part
For reference, I have installed the Heroku redis add-on.
In config/environments/production.rb on line 2, change this:
mount ActionCable.server => '/cable'
to this:
config.action_cable.mount_path = "/cable"
I see mount ActionCable.server => '/cable' in config/environments/production.rb
https://github.com/sangyeol-kim/KNU_Community_Sy_part/blob/3dc80e210f3a8d40fb9184877098560c65d3b37f/config/environments/production.rb#L2
Remove that and try it out.

Rails.application.eager_load! not working in rake script

I'm trying to call Rails.application.eager_load! in my rake task.
This is the error that I'm getting.
LoadError: No such file to load -- application_controller
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:457:in `load'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:457:in `block in load_file'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:647:in `new_constants_in'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:456:in `load_file'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:354:in `require_or_load'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:317:in `depend_on'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:233:in `require_dependency'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:473:in `block (2 levels) in eager_load!'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:472:in `each'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:472:in `block in eager_load!'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:470:in `each'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:470:in `eager_load!'
/home/jkoehms/TECC/tecc/lib/tasks/populate.rake:3:in `<top (required)>'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:659:in `block in run_tasks_blocks'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:659:in `each'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:659:in `run_tasks_blocks'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/application.rb:452:in `run_tasks_blocks'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.1/lib/rails/engine.rb:453:in `load_tasks'
/home/jkoehms/TECC/tecc/Rakefile:6:in `<top (required)>'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in `eval'
/home/jkoehms/.rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in `<main>
Looking into this further, I found that the autoload_paths was empty in my active_support/dependencies.rb file. This should have been taken care of by the :set_autoload_paths initializer in engine.rb. However the initializer is never called. When I byebug into eager_load and manually call it myself the error goes away. Why isn't the initializer being called?
UPDATE:
when I call Rails.initialize! it then works. But this seems like a hefty call. Can someone explain what's happening?
I think you can find the answer about the reasons here: Rails 3 rake task can't find model in production
I have a similar problem before:
app#LacosteDev-aws:~/app/current$ rake resque:preload QUEUE=* --trace
** Invoke resque:preload (first_time)
** Invoke resque:setup (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute resque:setup
** Execute resque:preload
rake aborted!
NameError: uninitialized constant ResourcesController
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/bundler/gems/qor-c93ebb95226f/widget/app/controllers/resources/widget_controller.rb:2:in `const_missing'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/bundler/gems/qor-c93ebb95226f/widget/app/controllers/resources/widget_controller.rb:2
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in `load_dependency'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:348:in `require_or_load'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:302:in `depend_on'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:214:in `require_dependency'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/railties-3.1.3/lib/rails/engine.rb:417:in `eager_load!'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/railties-3.1.3/lib/rails/engine.rb:416:in `each'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/railties-3.1.3/lib/rails/engine.rb:416:in `eager_load!'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/railties-3.1.3/lib/rails/engine.rb:414:in `each'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/railties-3.1.3/lib/rails/engine.rb:414:in `eager_load!'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `to_proc'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/railties-3.1.3/lib/rails/application/railties.rb:8:in `each'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/railties-3.1.3/lib/rails/application/railties.rb:8:in `all'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/railties-3.1.3/lib/rails/engine.rb:412:in `eager_load!'
/media/ebsdisk/app/releases/20150630071432/vendor/bundle/ruby/1.8/gems/resque-1.25.2/lib/resque/tasks.rb:61
I just add config.dependency_loading = true if $rails_rake_task to config/environments/production.rb it works for me.
You can also set $rails_rake_task = true in your Rakefile manually.

heroku push error: "rake assets:precompile rake aborted!"

I'm trying to push my changes to Heroku with the following command: git push heroku master
When running the rake assets:precompile, I get the following error(s):
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
NameError: undefined local variable or method `fkalkhalidi' for #<Pinteresting::Application:0x007f48fd2d6fc0>
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/config/environments/production.rb:80:in `block in <top (required)>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/railtie.rb:210:in `instance_eval'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/railtie.rb:210:in `configure'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/config/environments/production.rb:1:in `<top (required)>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `block in require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/engine.rb:594:in `block (2 levels) in <class:Engine>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/engine.rb:593:in `each'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/engine.rb:593:in `block in <class:Engine>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:30:in `run'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:44:in `each'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:44:in `tsort_each_child'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/application.rb:300:in `initialize!'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/config/environment.rb:5:in `<top (required)>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `block in require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/application.rb:276:in `require_environment!'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/application.rb:389:in `block in run_tasks_blocks'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.2.0/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
Appreciate any help. First time learning RoR.
What's inside the file config/environments/production.rb at line 80?
Search your code, specifically in the production.rb file. It's likely there is a fkalkhalidi string somewhere that is causing the error.

Resources