1

I have a RoR application and when i try to deploy to my server via capistrano, i got this error message

/.rvm/gems/ruby-2.6.4@railsapp1/gems/sshkit-1.21.2/lib/sshkit/command.rb:97:in `exit_status=': bundle exit status: 127 (SSHKit::Command::Failed)
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory

this is happen when capistrano run task bundler:config (below)

00:52 bundler:config
      01 bundle config --local deployment true
      01 /usr/bin/env: bundle
      01 : No such file or directory

can anyone help me with this ? My server is using ruby virtual env instead of rvm and rbnev

Edit:

I already install bundler, but to run it i have to..let's say activate the ruby first with this script

/home/myusername/rubyvenv/staging_rails__app1/2.6/bin/activate

And i already add that script into capistrano as the first task executed, but the error is still there, is there something that i miss ?

namespace :deploy do
  before 'git:wrapper', :run_on_server
end

task :run_on_server do
  on roles(:app) do
    execute 'source /home/myusername/rubyvenv/staging_rails__app1/2.6/bin/activate' 
  end
end
Loadd64
  • 57
  • 8
  • Case done, please refer to this [link](https://stackoverflow.com/questions/3914694/bundler-command-not-found) – Loadd64 Feb 25 '21 at 14:49

1 Answers1

0

It seems you don't have the bundler gem installed in your server environment (which would provide the bundle executable).

You can install bundler with gem install bundler or gem install bundler -v VERSION (with VERSION being the exact version of bundler you are using to develop the app which is indicated in the last line of your Gemfile.lock.

Holger Just
  • 52,918
  • 14
  • 115
  • 123