Ruby on Rails: Cap production deploy not working

Viewed 263

I finished my app thats running with Ruby on Rails on my local machine. Now I want to finally deploy it fallowing a video from Youtube (https://www.youtube.com/watch?v=xpYpaRUFzTI&t=888s). When I type

cap production deploy

I get following error:

#<Thread:0x0000010ea8efd910 C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/ed25519_loader.rb:21:in `raiseUnlessLoaded': OpenSSH keys only supported if ED25519 is available (NotImplementedError)
net-ssh requires the following gems for ed25519 support:
 * ed25519 (>= 1.2, < 2.0)
 * bcrypt_pbkdf (>= 1.0, < 2.0)
See https://github.com/net-ssh/net-ssh/issues/565 for more information
LoadError : "cannot load such file -- bcrypt_pbkdf_ext"
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/key_factory.rb:200:in `classify_key'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/key_factory.rb:51:in `load_data_private_key'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/key_factory.rb:42:in `load_private_key'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/key_manager.rb:167:in `sign'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/methods/publickey.rb:62:in `authenticate_with'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/methods/publickey.rb:20:in `block in authenticate'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/key_manager.rb:132:in `block in each_identity'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/key_manager.rb:129:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/key_manager.rb:129:in `each_identity'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/methods/publickey.rb:19:in `authenticate'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/session.rb:86:in `block in authenticate'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/session.rb:72:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/authentication/session.rb:72:in `authenticate'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:255:in `start'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/connection_pool.rb:63:in `call'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/connection_pool.rb:63:in `with'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:177:in `with_ssh'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:130:in `execute_command'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
        from <internal:kernel>:90:in `tap'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:61:in `test'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/capistrano-rbenv-2.2.0/lib/capistrano/tasks/rbenv.rake:10:in `block (3 levels) in <top (required)>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
(Backtrace restricted to imported tasks)
cap aborted!
NotImplementedError: OpenSSH keys only supported if ED25519 is available
net-ssh requires the following gems for ed25519 support:
 * ed25519 (>= 1.2, < 2.0)
 * bcrypt_pbkdf (>= 1.0, < 2.0)
See https://github.com/net-ssh/net-ssh/issues/565 for more information
LoadError : "cannot load such file -- bcrypt_pbkdf_ext"

Tasks: TOP => rbenv:validate
(See full trace by running task with --trace)

My Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.0.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.4', '>= 6.1.4.1'
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
gem 'rbnacl', '< 5.0', :require => false                                                                                                                                                                
#gem 'rbnacl-libsodium', :require => false                                                                                                                                                               
gem 'bcrypt_pbkdf', '< 2.0', :require => false
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'ed25519', '>= 1.2', '< 2.0'

# Use Active Storage variant
#gem 'image_processing', '~> 1.2'
#gem 'activestorage-validations'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.4', require: false

#devise
gem 'devise', '~> 4.8'

#activeadmin
gem 'activeadmin', '~> 2.9'

#ransack
gem 'ransack', '~> 2.5'

#pagination
gem 'kaminari', '~> 1.2', '>= 1.2.2'

gem 'capistrano', '~> 3.11'
gem 'capistrano-passenger', '~> 0.2.0'
gem 'capistrano-rails', '~> 1.4'
gem 'capistrano-rbenv', '~> 2.1', '>= 2.1.4'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 4.1.0'
  # Display performance information such as SQL time and flame graphs for each request in your browser.
  # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
  gem 'rack-mini-profiler', '~> 2.0'
  # Use sqlite3 as the database for Active Record
  gem 'sqlite3', '~> 1.4'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 3.26'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

It shows me in the error message, that I showld add both of those gems. But then I still get the same error message. Does somebody know how I can solve that probleme? That would realy help me a lot. Thank you so much for your time reading this. I hope I described my problem as precise as possible.

1 Answers

If you are using mac, then run the following command. It will fix this issue.

ssh-add
Related