【问题标题】:SSHKit::Runner::ExecuteError: Exception while executingSSHKit::Runner::ExecuteError:执行时出现异常
【发布时间】:2016-04-08 04:36:50
【问题描述】:

我在通过 Capistrano 部署 Rails 应用程序时遇到问题,以下是部署过程的日志。

DEBUG [9d92ed37] Command: cd /var/www/PROJECT-NAME/releases/20160408041814 && /usr/local/rvm/bin/rvm ruby-2.2.1 do bundle install --path /var/www/PROJECT-NAME/shared/bundle --without development test --deployment --quiet
DEBUG [9d92ed37]    bash: line 1:  2027 Killed                  /usr/local/rvm/bin/rvm ruby-2.2.1 do bundle install --path /var/www/PROJECT-NAME/shared/bundle --without development test --deployment --quiet
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as root@X.X.X.X: bundle exit status: 137
bundle stdout: Nothing written
bundle stderr: bash: line 1:  2027 Killed                  /usr/local/rvm/bin/rvm ruby-2.2.1 do bundle install --path /var/www/PROJECT-NAME/shared/bundle --without development test --deployment --quiet

SSHKit::Command::Failed: bundle exit status: 137
bundle stdout: Nothing written
bundle stderr: bash: line 1:  2027 Killed                  /usr/local/rvm/bin/rvm ruby-2.2.1 do bundle install --path /var/www/PROJECT-NAME/shared/bundle --without development test --deployment --quiet

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as root@X.X.X.X: bundle exit status: 137
bundle stdout: Nothing written
bundle stderr: bash: line 1:  2027 Killed                  /usr/local/rvm/bin/rvm ruby-2.2.1 do bundle install --path /var/www/PROJECT-NAME/shared/bundle --without development test --deployment --quiet
dipak@Dipak:/dipak/sites/PROJECT-NAMEs-Latest$ 

无法理解解决方案是什么。在它工作正常之前,但突然它给了我错误。

如果存储有问题,那么我还有很多空间。

Filesystem      Size  Used Avail Use% Mounted on
udev            230M     0  230M   0% /dev
tmpfs            49M  616K   49M   2% /run
/dev/vda1        20G  8.4G   11G  46% /
tmpfs           245M  4.0K  245M   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           245M     0  245M   0% /sys/fs/cgroup
tmpfs            49M     0   49M   0% /run/user/0

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 capistrano


    【解决方案1】:

    您可以为您的 linux 服务器添加 2GB 的交换内存 我在 capistrano 运行时使用 htop 来查看 ram,在我的服务器中,有 4GB 的 ram,这已经满了。因此,我添加了 2GB 的交换空间,并且 capistrano 使用了该站点。 https://hk.godaddy.com/en/help/add-memory-swap-centos-17328

    【讨论】:

      【解决方案2】:

      SSHKit::Runner::ExecuteError: 失败意味着 prod 服务器无法正确处理您的请求。尝试在您部署到的用户上安装 nodejsyarn。 Docker 通过从开发人员那里抽象出大部分生产配置来简化堆栈。

      cap production deploy --trace
      
      sudo apt-get install nodejs
      
      curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
      
      echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
      
      sudo apt update
      
      sudo apt install yarn
      

      yarn --version

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-12-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-09-15
        • 2021-04-10
        • 2018-11-13
        相关资源
        最近更新 更多