ruby 2.5 on ubuntu:latest error assets:precompile - ruby-on-rails

I support Rails 4.2.5 application on Ruby 2.5. Packages and rails are ok, but when I run rake assets:precompile I have error.
eric>'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/subscriber.rb:80:in `join'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/subscriber.rb:80:in `initialize'
/var/lib/gems/2.5.0/gems/activerecord-4.2.5/lib/active_record/log_subscriber.rb:19:in `initialize'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/subscriber.rb:33:in `new'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/subscriber.rb:33:in `attach_to'
/var/lib/gems/2.5.0/gems/activerecord-4.2.5/lib/active_record/log_subscriber.rb:75:in `<top (required)>'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/2.5.0/gems/activerecord-4.2.5/lib/active_record/railties/controller_runtime.rb:2:in `<top (required)>'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/2.5.0/gems/activerecord-4.2.5/lib/active_record/railtie.rb:138:in `block in <class:Railtie>'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/railtie.rb:194:in `public_send'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/railtie.rb:194:in `method_missing'
/wealthoz/config/environment.rb:5:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/application.rb:328:in `require'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/application.rb:328:in `require_environment!'
/var/lib/gems/2.5.0/gems/railties-4.2.5/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/var/lib/gems/2.5.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
I don't deploy intro docker containers on ruby 2.5 image.

If you are on production environment, try RAILS_ENV=production rake assets:precompile

I think you should stick with Ruby 2.3, you could experience many runtime errors with 2.5 (like this one you reported)

Related

LoadError: cannot load such file -- rails_helper (Rails 6 and Rspec)

I am trying to write rspec tests for a rails 6 project.
When I run
rspec spec/controllers/user_spec.rb
I get this error
Migrations are pending. To resolve this issue,
run:rails db:migrate RAILS_ENV=test
No examples found.
So I run
rails db:migrate RAILS_ENV=test
and then I get this error
rails aborted!
LoadError: cannot load such file -- rails_helper
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
/Users/MacBookAir/workspace/squealer/spec/factories/devise.rb:1:in `<main>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:20:in `block (2 levels) in find_definitions'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:19:in `each'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:19:in `block in find_definitions'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:15:in `each'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:15:in `find_definitions'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/reload.rb:6:in `reload'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot_rails-5.1.1/lib/factory_bot_rails/railtie.rb:26:in `block in <class:Railtie>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/application/finisher.rb:129:in `block in <module:Finisher>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `instance_exec'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `run'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/initializable.rb:60:in `run_initializers'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/application.rb:363:in `initialize!'
/Users/MacBookAir/workspace/squealer/config/environment.rb:14:in `<main>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/application.rb:339:in `require_environment!'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/application.rb:515:in `block in run_tasks_blocks'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/command.rb:48:in `invoke'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/commands.rb:18:in `<main>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
/Users/MacBookAir/workspace/squealer/bin/rails:9:in `<top (required)>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/MacBookAir/workspace/squealer/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Caused by:
Bootsnap::LoadPathCache::FallbackScan:
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
So then I remove the bootsnap gem and go to config/boot.rb and remove this line
require 'bootsnap/setup'
Then I run bundle install and then try to run rails db:migrate RAILS_ENV=test once more.
I get another error
rails aborted!
LoadError: cannot load such file -- rails_helper
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
/Users/MacBookAir/workspace/squealer/spec/factories/devise.rb:1:in `<top (required)>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:20:in `load'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:20:in `block (2 levels) in find_definitions'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:19:in `each'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:19:in `block in find_definitions'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:15:in `each'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/find_definitions.rb:15:in `find_definitions'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot-5.1.1/lib/factory_bot/reload.rb:6:in `reload'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/factory_bot_rails-5.1.1/lib/factory_bot_rails/railtie.rb:26:in `block in <class:Railtie>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/application/finisher.rb:129:in `block in <module:Finisher>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `instance_exec'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `run'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/initializable.rb:60:in `run_initializers'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/application.rb:363:in `initialize!'
/Users/MacBookAir/workspace/squealer/config/environment.rb:14:in `<top (required)>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/application.rb:339:in `require_environment!'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/application.rb:515:in `block in run_tasks_blocks'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/command.rb:48:in `invoke'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/railties-6.0.1/lib/rails/commands.rb:18:in `<top (required)>'
/Users/MacBookAir/workspace/squealer/bin/rails:9:in `require'
/Users/MacBookAir/workspace/squealer/bin/rails:9:in `<top (required)>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
/Users/MacBookAir/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/MacBookAir/workspace/squealer/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
At this point, I am ready to toss my laptop into the trash. I don't even know what the zeitwerk gem is or what a thread safe code loader does. I just know it's required for Rails 6.
My github repo is here
Does anyone know what I am doing wrong?
Ah - I figured it out. I didn't read my error logs carefully.
I am using the Devise gem. In my error logs, the 8th line down mentioned a file in spec/factories/devise.rb
I looked at that file and saw that I had placed
require 'rails_helper.rb' at the top of the file.
I removed that line and now I can run
rails db:migrate RAILS_ENV=TEST
Guess this is a lesson in reading the error logs carefully
I just went through your repo. You actually don't have a rails_helper file. You should do a find and replace for rails_helper, replacing it with test_helper

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.

Numeric conversion error with PostgreSQL and Rails

I'm getting the following error output when trying to run RAILS_ENV=production rake db:migrate on an Ubuntu instance:
/usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
And the following output as well:
/usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.6/lib/active_support/cache/strategy/local_cache.rb:138:in `local_cache_key'
/usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.6/lib/active_support/cache/strategy/local_cache.rb:74:in `middleware'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/application/bootstrap.rb:79:in `block in <module:Bootstrap>'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `run'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/application.rb:352:in `initialize!'
/home/rails/gsc_surveying/config/environment.rb:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/application.rb:328:in `require'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/application.rb:328:in `require_environment!'
/usr/local/rvm/gems/ruby-2.4.0/gems/railties-4.2.6/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate => environment
Switching to Ruby 2.3.1 fixed the issue.

Can't push changes to heroku

I've added Twilio to my rails app and when I go to push the changes to heroku I'm getting the following error. I've having trouble tracing it back to the issue.
Running: rake assets:precompile
rake aborted!
undefined method `strip' for nil:NilClass
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/twilio-ruby-3.11.5/lib/twilio-ruby/rest/client.rb:142:in `initialize'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/config/initializers/twilio.rb:6:in `new'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/config/initializers/twilio.rb:6:in `<top (required)>'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `each'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `block in <class:Engine>'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/config/environment.rb:5:in `<top (required)>'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:250:in `block in run_tasks_blocks'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
Update: In my Twilio.rb (config/initializer) I had copied over some code from Twilio's site.
require "twilio-ruby"
Once I removed this I was able to get it to push to heroku.

cannot load such file -- paypal/express on db migrate

I have installed the paypal express gem and after trying to do migrations I receive a cannot load such file -- paypal/express error.
Log:
$ gem install paypal-express
Successfully installed paypal-express-0.5.5
Parsing documentation for paypal-express-0.5.5
1 gem installed
$ rake db:migrate
rake aborted!
cannot load such file -- paypal/express
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:in `require'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:in `block in require'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:213:in `load_dependency'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:in `require'
/dating/config/initializers/paypal.rb:1:in `<top (required)>'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:222:in `load'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:222:in `block in load'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:213:in `load_dependency'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:222:in `load'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/engine.rb:608:in `each'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/engine.rb:608:in `block in <class:Engine>'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:30:in `instance_exec'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:30:in `run'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:55:in `block in run_initializers'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:44:in `each'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:44:in `tsort_each_child'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:54:in `run_initializers'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/application.rb:214:in `initialize!'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/railtie/configurable.rb:30:in `method_missing'
/dating/config/environment.rb:5:in `<top (required)>'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:in `require'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:in `block in require'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:213:in `load_dependency'
/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:in `require'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/application.rb:188:in `require_environment!'
/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0.rc1/lib/rails/application.rb:248:in `block in run_tasks_blocks'
/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate => environment
Put gem 'paypal-express' in your Gemfile and run bundle install. You shouldn't even have to require paypal/express in your initializer.

Resources