<p>mina deploy throws error - bundel: perintah tidak ditemukan! GALAT: Penerapan gagal.</p>

Dibuat pada 28 Nov 2017  ·  6Komentar  ·  Sumber: mina-deploy/mina

mina menyebarkan kesalahan lemparan. Bantuan apa pun akan sangat dihargai.

Ini dia mina deploy --trace

root@ruby-rails-1gb-blr1-01:/home/rails/rails-demo# mina deploy --trace
** Invoke deploy (first_time)
** Execute deploy
** Invoke remote_environment (first_time)
** Execute remote_environment
** Invoke git:clone (first_time)
** Execute git:clone
** Invoke deploy:link_shared_paths (first_time)
** Execute deploy:link_shared_paths
** Invoke bundle:install (first_time)
** Execute bundle:install
** Invoke rails:db_migrate (first_time)
** Execute rails:db_migrate
** Invoke rails:assets_precompile (first_time)
** Execute rails:assets_precompile
** Invoke deploy:cleanup (first_time)
** Execute deploy:cleanup
** Invoke puma:phased_restart (first_time)
** Invoke remote_environment (first_time)
** Execute remote_environment
** Execute puma:phased_restart
[email protected]'s password: 
-----> Creating a temporary build path
-----> Deploying rails-demo to 139.59.72.156:/home/rails/rails-demo
-----> Fetching new git commits
       remote: Counting objects: 43, done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 43 (delta 6), reused 43 (delta 6), pack-reused 0
Unpacking objects: 100% (43/43), done.   
       From github.com:krishnateja/rails-demo
          739096a..4cf74f8  master     -> master
-----> Using git branch 'master'
       Cloning into '.'...
       done.
-----> Using this git commit
       root (4cf74f8):
       > small config change
-----> Symlinking shared paths
-----> Installing gem dependencies using Bundler
       bash: line 137: bundle: command not found
 !     ERROR: Deploy failed.
-----> Cleaning up build
       Unlinking current
       OK
       Connection to 139.59.72.156 closed.

 !     Run Error

menyebarkan.rb

require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
require 'mina/puma'

set :application_name, 'rails-demo'
set :domain, '139.59.72.156'
set :deploy_to, '/home/rails/rails-demo'
set :repository, '[email protected]:krishnateja/rails-demo.git'

set :shared_dirs, fetch(:shared_dirs, []).push('log', 'tmp/pids', 'tmp/sockets', 'public/uploads')
set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml', 'config/puma.rb')
set :user, 'root'

task :environment do
  invoke :'rvm:use', 'ruby-2.2.3'
end

task :setup do
  command %[touch "#{fetch(:shared_path)}/config/database.yml"]
  command %[touch "#{fetch(:shared_path)}/config/secrets.yml"]
  command %[touch "#{fetch(:shared_path)}/config/puma.rb"]
  comment "Be sure to edit '#{fetch(:shared_path)}/config/database.yml', 'secrets.yml' and puma.rb."
end

task :deploy do
  deploy do
    comment "Deploying #{fetch(:application_name)} to #{fetch(:domain)}:#{fetch(:deploy_to)}"
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile'
    invoke :'deploy:cleanup'

    on :launch do
      invoke :'puma:phased_restart'
    end
  end

end

puma.rb

environment "production"

bind  "unix:///home/rails/rails-demo/shared/tmp/sockets/puma.sock"
pidfile "/home/rails/rails-demo/shared/tmp/pids/puma.pid"
state_path "/home/rails/rails-demo/shared/tmp/sockets/puma.state"
directory "/home/rails/rails-demo/current"

workers 2
threads 1,2

daemonize true

activate_control_app 'unix:///home/rails/rails-demo/shared/tmp/sockets/pumactl.sock'

prune_bundler

Komentar yang paling membantu

Jika Anda menggunakan blok :environment , ganti namanya menjadi :remote_environment untuk menargetkan server jauh, atau jalankan mina init untuk menyalin skrip penerapan baru (cadangkan deploy.rb pertama). Ini juga terjadi pada saya, meskipun menggunakan rbenv alih-alih rvm.

Semua 6 komentar

Saya memiliki masalah yang sama setelah saya memperbarui gemfile saya

Coba jalankan Sudo gem install Ruby-bundler.

Itu harus menyelesaikan masalah.

Pada hari Jumat, 8 Desember 2017, zhangmingchang [email protected]
menulis:

Saya memiliki masalah yang sama setelah saya memperbarui gemfile saya


Anda menerima ini karena Anda yang menulis utas.
Balas email ini secara langsung, lihat di GitHub
https://github.com/mina-deploy/mina/issues/594#issuecomment-350198303 ,
atau matikan utasnya
https://github.com/notifications/unsubscribe-auth/AAeZsg2vTdUuBcHdfXCugGXTBZFkHpuXks5s-OwQgaJpZM4QtZ6B
.

Coba bundle exec mina deploy
Ini memecahkan milikku.

Ketika datang ke kesalahan "perintah tidak ditemukan: bundel", alasan utamanya adalah bahwa orang tidak menginstalnya di server mereka untuk versi Ruby tertentu. Jika Anda menggunakan Rbenv, Rvm... hanya beralih ke versi yang tepat dan menjalankan gem install bundler .
Saya menggunakan Rbenv, jadi setiap kali saya ingin menggunakan aplikasi yang akan menggunakan Ruby versi baru (yang belum saya instal), saya ssh ke server saya dan menjalankan

rbenv install 2.5.0
rbenv shell 2.5.0
gem install bundler

Lihat FAQ

Jika Anda menggunakan blok :environment , ganti namanya menjadi :remote_environment untuk menargetkan server jauh, atau jalankan mina init untuk menyalin skrip penerapan baru (cadangkan deploy.rb pertama). Ini juga terjadi pada saya, meskipun menggunakan rbenv alih-alih rvm.

Apakah halaman ini membantu?
0 / 5 - 0 peringkat