Capistrano deploy rails fails on nokogiri - ruby-on-rails

I get the following error when deploying to Ubuntu using:
ruby '2.3.0'
gem 'rails', '~> 4.2', '>= 4.2.5.1'
gem 'rake', '~> 11.3'
gem 'capistrano', '~> 3.9'
This is my server log:
00:29 deploy:assets:precompile
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
01 rake aborted!
01 LoadError: libruby.so.2.3: cannot open shared object file: No such file or directory - /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri/nokogiri.so
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:32:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:32:in `rescue in <top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:28:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml.rb:2:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml.rb:2:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-aws-1.4.1/lib/fog/aws.rb:2:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-aws-1.4.1/lib/fog/aws.rb:2:in `<top (required)>'
01 /home/myapp/myappWeb/releases/20171121132549/config/application.rb:3:in `require'
01 /home/myapp/myappWeb/releases/20171121132549/config/application.rb:3:in `<top (required)>'
01 /home/myapp/myappWeb/releases/20171121132549/Rakefile:4:in `require'
01 /home/myapp/myappWeb/releases/20171121132549/Rakefile:4:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
01 /home/myapp/.rbenv/versions/2.3.0/bin/bundle:23:in `load'
01 /home/myapp/.rbenv/versions/2.3.0/bin/bundle:23:in `<main>'
01 LoadError: cannot load such file -- nokogiri/2.3/nokogiri
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:30:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:30:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml.rb:2:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml.rb:2:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-aws-1.4.1/lib/fog/aws.rb:2:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-aws-1.4.1/lib/fog/aws.rb:2:in `<top (required)>'
01 /home/myapp/myappWeb/releases/20171121132549/config/application.rb:3:in `require'
01 /home/myapp/myappWeb/releases/20171121132549/config/application.rb:3:in `<top (required)>'
01 /home/myapp/myappWeb/releases/20171121132549/Rakefile:4:in `require'
01 /home/myapp/myappWeb/releases/20171121132549/Rakefile:4:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
01 /home/myapp/.rbenv/versions/2.3.0/bin/bundle:23:in `load'
01 /home/myapp/.rbenv/versions/2.3.0/bin/bundle:23:in `<main>'
01 (See full trace by running task with --trace)

What do you get if you try to run gem install nokogiri from your app directory on your server?
You might be missing some librairies on your server. See http://www.nokogiri.org/tutorials/installing_nokogiri.html

I reinstalled the entire ubuntu system on the server. Then reinstalled ruby and bundler. Everything worked after this.

Related

LoadError: incompatible library version, when deploying with capistrano to Digital Ocean

When I run cap staging deploy, I get the error
LoadError: incompatible library version - /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack/ms…
Assets won't precompile when deploying with capistrano to production on Amazon EC2. But I didn't find any solution there.
00:42 deploy:assets:precompile
01 bundle exec rake assets:precompile
01 rake aborted!
01 LoadError: incompatible library version - /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack/ms…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:11:in `require'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:11:in `rescue in <top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:8:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `require'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `block in <to…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/explicit_require.rb:43:in `rescue in with_g…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/explicit_require.rb:39:in `with_gems'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `<top (requir…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap.rb:3:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap.rb:3:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/setup.rb:1:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/setup.rb:1:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/config/boot.rb:6:in `require'
01 /var/www/dbname_staging/releases/20190514174408/config/boot.rb:6:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/config/application.rb:3:in `require_relative'
01 /var/www/dbname_staging/releases/20190514174408/config/application.rb:3:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/Rakefile:6:in `require_relative'
01 /var/www/dbname_staging/releases/20190514174408/Rakefile:6:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
01 /usr/local/bin/bundle:23:in `load'
01 /usr/local/bin/bundle:23:in `<main>'
01
01 Caused by:
01 LoadError: cannot load such file -- msgpack/2.6/msgpack
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:9:in `require'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:9:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `require'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `block in <to…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/explicit_require.rb:43:in `rescue in with_g…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/explicit_require.rb:39:in `with_gems'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `<top (requir…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap.rb:3:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap.rb:3:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/setup.rb:1:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/setup.rb:1:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/config/boot.rb:6:in `require'
01 /var/www/dbname_staging/releases/20190514174408/config/boot.rb:6:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/config/application.rb:3:in `require_relative'
01 /var/www/dbname_staging/releases/20190514174408/config/application.rb:3:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/Rakefile:6:in `require_relative'
01 /var/www/dbname_staging/releases/20190514174408/Rakefile:6:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
01 /usr/local/bin/bundle:23:in `load'
01 /usr/local/bin/bundle:23:in `<main>'
01
01 Caused by:
01 LoadError: incompatible library version - /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack/ms…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:11:in `require'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:11:in `rescue in <top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:8:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `require'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `block in <to…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/explicit_require.rb:40:in `with_gems'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `<top (requir…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap.rb:3:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap.rb:3:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/setup.rb:1:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/setup.rb:1:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/config/boot.rb:6:in `require'
01 /var/www/dbname_staging/releases/20190514174408/config/boot.rb:6:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/config/application.rb:3:in `require_relative'
01 /var/www/dbname_staging/releases/20190514174408/config/application.rb:3:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/Rakefile:6:in `require_relative'
01 /var/www/dbname_staging/releases/20190514174408/Rakefile:6:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
01 /usr/local/bin/bundle:23:in `load'
01 /usr/local/bin/bundle:23:in `<main>'
01
01 Caused by:
01 LoadError: cannot load such file -- msgpack/2.6/msgpack
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:9:in `require'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/msgpack-1.2.10/lib/msgpack.rb:9:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `require'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `block in <to…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/explicit_require.rb:40:in `with_gems'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/store.rb:3:in `<top (requir…
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap.rb:3:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap.rb:3:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/setup.rb:1:in `require_relative'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/setup.rb:1:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/config/boot.rb:6:in `require'
01 /var/www/dbname_staging/releases/20190514174408/config/boot.rb:6:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/config/application.rb:3:in `require_relative'
01 /var/www/dbname_staging/releases/20190514174408/config/application.rb:3:in `<top (required)>'
01 /var/www/dbname_staging/releases/20190514174408/Rakefile:6:in `require_relative'
01 /var/www/dbname_staging/releases/20190514174408/Rakefile:6:in `<top (required)>'
01 /var/www/dbname_staging/shared/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
01 /usr/local/bin/bundle:23:in `load'
01 /usr/local/bin/bundle:23:in `<main>'
01 (See full trace by running task with --trace)
#<Thread:0x00005581529e8788#/home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
13: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
12: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:29:in `run'
11: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
10: from /home/compname/.rvm/gems/ruby-2.6.3/gems/capistrano-rails-1.4.0/lib/capistrano/tasks/assets.rake:67:in `block (4 levels) in <top (required)>'
9: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:89:in `within'
8: from /home/compname/.rvm/gems/ruby-2.6.3/gems/capistrano-rails-1.4.0/lib/capistrano/tasks/assets.rake:68:in `block (5 levels) in <top (required)>'
7: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:97:in `with'
6: from /home/compname/.rvm/gems/ruby-2.6.3/gems/capistrano-rails-1.4.0/lib/capistrano/tasks/assets.rake:69:in `block (6 levels) in <top (required)>'
5: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:78:in `execute'
4: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `create_command_and_execute'
3: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `tap'
2: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/abstract.rb:145:in `block in create_command_and_execute'
1: from /home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/backends/netssh.rb:169:in `execute_command'
/home/compname/.rvm/gems/ruby-2.6.3/gems/sshkit-1.18.2/lib/sshkit/command.rb:99:in `exit_status=': rake exit status: 1 (SSHKit::Command::Failed)
rake stdout: Nothing written
rake stderr: rake aborted!

I'm trying to deploy in the digital ocean, when the final part arrives ActiveSupport::MessageEncryptor::InvalidMessage

I'm trying to deploy in the digital ocean, when the final part arrives ~ / .rvm / bin / rvm 2.4.4 from the bundle exec rake assets: precompile
it returns this error ActiveSupport :: MessageEncryptor :: InvalidMessage: ActiveSupport :: MessageEncryptor :: InvalidMessage Who can give me a power already thank you!
00:06 deploy:assets:precompile
01 ~/.rvm/bin/rvm 2.4.4 do bundle exec rake assets:precompile
01 rake aborted!
01 ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:183:in `_decrypt'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:79:in `decrypt'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:42:in `read'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:21:in `read'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:33:in `config'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:38:in `options'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missin…
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:433:in `secret_key_base'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:176:in `key_generator'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/globalid-0.4.1/lib/global_id/railtie.rb:26:in `block (2 levels) in <class:Railtie>'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:51:in `each'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application/finisher.rb:75:in `block in <module:Finisher>'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
01 /var/www/jrpescados/releases/20180606215329/config/environment.rb:5:in `<main>'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in req…
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with…
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
01 /var/www/jrpescados/shared/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
01 /home/deploy/.rvm/rubies/ruby-2.4.4/bin/bundle:30:in `block in <main>'
01 /home/deploy/.rvm/rubies/ruby-2.4.4/bin/bundle:22:in `<main>'
01 /home/deploy/.rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:15:in `eval'
01 /home/deploy/.rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:15:in `<main>'
I have encountered your problem and solved it.
The reason of problem is rails 5.2.0 couldn't get your secret_key_base. You can use gem dotrails in Gemfile and then type command in terminal at local machine: bundle install.
Then add .env to shared/ directory at rails app of remote machine and its content is SECRET_KEY_BASE = 'YOURSECRETKEY'. Also add .env to config/deploy.rb file such as
append :linked_files, ".env"
Kindly reminder: add .env to your .gitignore file.
Last, deploy your app again by capistrano.
Cheers,
Try adding this to your deploy.rb file
before "deploy:assets:precompile", "bundle:install"

Error while running rake routes

Getting error while running rake routes. Please suggest.
$ rake routes
rake aborted!
LoadError: incompatible library version -
/home/latei/.rvm/gems/ruby-2.4.1/gems/sqlite3-1.3.13/lib/sqlite3/sqlite3_native.so
/home/latei/.rvm/gems/ruby-2.4.1/gems/sqlite3-1.3.13/lib/sqlite3.rb:6:in
`require'
/home/latei/.rvm/gems/ruby-2.4.1/gems/sqlite3-1.3.13/lib/sqlite3.rb:6:in
`rescue in <top (required)>'
/home/latei/.rvm/gems/ruby-2.4.1/gems/sqlite3-1.3.13/lib/sqlite3.rb:2:in
`<top (required)>'
/home/latei/Desktop/rails/alpha-blog/config/application.rb:7:in `<top
(required)>' /home/latei/Desktop/rails/alpha-blog/Rakefile:4:in
`require_relative' /home/latei/Desktop/rails/alpha-blog/Rakefile:4:in
`<top (required)>'
/home/latei/.rvm/gems/ruby-2.4.1#global/gems/rake-12.0.0/exe/rake:27:in
`<top (required)>' LoadError: cannot load such file --
sqlite3/2.3/sqlite3_native
/home/latei/.rvm/gems/ruby-2.4.1/gems/sqlite3-1.3.13/lib/sqlite3.rb:4:in
`require'
/home/latei/.rvm/gems/ruby-2.4.1/gems/sqlite3-1.3.13/lib/sqlite3.rb:4:in
`<top (required)>'
/home/latei/Desktop/rails/alpha-blog/config/application.rb:7:in `<top
(required)>' /home/latei/Desktop/rails/alpha-blog/Rakefile:4:in
`require_relative' /home/latei/Desktop/rails/alpha-blog/Rakefile:4:in
`<top (required)>'
/home/latei/.rvm/gems/ruby-2.4.1#global/gems/rake-12.0.0/exe/rake:27:in
`<top (required)>' (See full trace by running task with --trace)
It appears that you may be lacking the necessary development library required to use the sqlite gem.
In debian this can be installed using the following command:
sudo apt-get install libsqlite-3
I am not sure, but I think the problem is in your gem version, Try this one:
gem 'sqlite3', '~> 1.3', '>= 1.3.10'
and then $ bundle install

Unable to generate rspec in rails project, "uninitialized constant RSpec (NameError) is thrown"

>: rails generate rspec:install
/Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.1.7/lib/rspec/core/formatters/base_formatter.rb:1:in `<top (required)>': uninitialized constant RSpec (NameError)
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481/gems/allure-rspec-0.6.7/lib/allure-rspec/formatter.rb:1:in `require'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481/gems/allure-rspec-0.6.7/lib/allure-rspec/formatter.rb:1:in `<top (required)>'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481/gems/allure-rspec-0.6.7/lib/allure-rspec.rb:3:in `require'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481/gems/allure-rspec-0.6.7/lib/allure-rspec.rb:3:in `<top (required)>'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /Users/prashanth_sams/Desktop/MAC/blog/config/application.rb:7:in `<top (required)>'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.16/lib/rails/commands.rb:24:in `require'
from /Users/prashanth_sams/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.16/lib/rails/commands.rb:24:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I tried the below cmd in Terminal
bundle exec rails generate rspec:install
but no luck :(
Placed the below in my Gemfile
group :test, :development do
gem 'rspec-rails', '~> 3.1.0'
end
May be the version of Rspec is incompatible: downgrade the version of rspec or just write:
gem 'rspec-rails'
then you can update it:
bundle update rspec-rails
I am able to create the spec folder and spec_helper.rb using
rspec --init

Rake gets aborted with error: no such file to load -- openssl

I keep getting openssl issues on my Mac. I am completely perplexed by the error messages when I try to issue rails tasks. What might be the issue?
I definitely have openssl on my machine because when I type it in the terminal, it opens an openSSL> session.
Every time I try the following: RAILS_ENV=development rake db:migrate
I get the below error:
rake aborted!
no such file to load -- openssl
(See full trace by running task with --trace)
When I type the above with --trace option, it shows an error which is listed below.
When I try to launch rails server by typing rails s I get the below error:
$> rails s
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/openssl.rb:2:in `require': no such file to load -- openssl (LoadError)
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/openssl.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/buffer.rb:2:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/buffer.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/algorithms.rb:1:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/algorithms.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/session.rb:7:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/session.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh.rb:10:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh.rb:10:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-gateway-1.2.0/lib/net/ssh/gateway.rb:2:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-gateway-1.2.0/lib/net/ssh/gateway.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration/connections.rb:2:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration/connections.rb:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration.rb:5:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano.rb:3:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano.rb:3:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
from /Users/imtiazahmad/scripts/xxx-patchtrack/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Try rebuilding ruby with ssl support:
port install openssl +universal
rvm install 1.9.2 --with-openssl-dir=/opt/local

Resources