Tag: capistrano3

Rails 4 + Capistrano 3:致命:部署时无法从远程存储库读取

我在使用Capistrano 3部署Rails 4应用程序时遇到以下错误 INFO [87512eb8] Running /usr/bin/env chmod +x /tmp/magnificent/git-ssh.sh as deploy@104.236.6.180 DEBUG [87512eb8] Command: /usr/bin/env chmod +x /tmp/magnificent/git-ssh.sh INFO [87512eb8] Finished in 0.444 seconds with exit status 0 (successful). INFO [1ec94dd1] Running /usr/bin/env git ls-remote –heads git@github.com:BoTreeConsultingTeam/magnificent.git as deploy@104.236.6.180 DEBUG [1ec94dd1] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/magnificent/git-ssh.sh /usr/bin/env git ls-remote –heads git@github.com:BoTreeConsultingTeam/magnificent.git ) DEBUG [1ec94dd1] ERROR: […]

Capistrano 3 sudo任务

我想用Capistrano 3编写一个配方,用sudo在远程服务器上执行任务。 有了Capistrano 2,这可以做到例如: default_run_options[:pty] = true task :hello do run “#{sudo} cp ~/something /something” end 随着Capistrano 3,我发现: set :pty, true 但我无法执行使用sudo运行的任务。 如何使用sudo运行任务?

Capistrano 3资产:预编译需要数小时。 停在css文件

就像它说的那样,我无法让capistrano 3做assets:precompile正确assets:precompile 。 即使在数小时后,它仍然会写入服务器上的.css文件。 更新: 我在玩,我尝试了m1.medium。 同样的事情发生在某个点上它只是停止了预编译。 不抛出错误,光标只是闪烁。 它看起来仍然有效,因为它只是说: 我,[2013-12-31T01:18:45.210416#31413]信息 – :写作/var/www/app/releases/20131231011622/public/assets/application-998b176a776d6aff56fce8af9ca0d861.css 当我从任何实例查看cpu用法时它看起来像这样: 看起来这个过程已经完成,但事实并非如此。 我从零开始创建了一个假应用程序,它使用相同的capistrano设置完美上传。 我正在使用ckeditor,bootstrap-sass和自定义引擎,如果这有所作为。 如果我需要显示任何其他文件,我很乐意在这里添加它们。 谢谢 更新2我让它在m1.medium实例上工作,但它仍然在m1.small或t1.micro实例上失败。 所以我认为它与ssh有关。

cap deploy + rbenv:bundle:找不到命令

我关注https://gorails.com/deploy/ubuntu/16.04 我正在运行:“捆绑exec cap生产部署”并收到以下错误: ✔ 10 deploy@107.170.84.18 0.289s 00:21 bundler:install 01 $HOME/.rbenv/bin/rbenv exec bundle install –path /home/deploy/deploy_test1/shared/bundle –without development test –deployment –q… 01 rbenv: bundle: command not found 01 01 The `bundle’ command exists in these Ruby versions: 01 2.4.0 01 (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as deploy@107.170.84.18: bundle exit […]

SSHKit ::亚军:: ExecuteError

$ bundle exec cap production deploy (Backtrace限制为导入任务)上限中止! SSHKit ::亚军:: ExecuteError: 执行Psara @ sakura时出现exception:git退出状态:128 git stdout:没有写git stderr:Permission denied(publickey)。 致命:远程端意外挂断 SSHKit ::命令::失败: git退出状态:128 git stdout:没有写 git stderr:权限被拒绝(publickey)。 致命:远程端意外挂断 任务:TOP => git:check(通过使用–trace运行任务来查看完整跟踪)部署失败并显示错误: 执行Psara @ sakura时出现exception: git退出状态:128 git stdout:没有写任何内容 git stderr:权限被拒绝(publickey)。 致命:远程端意外挂断 * deploy.rb 设置:应用程序,’Psara’ set:repo_url,’git @ bitbucket.org:CBLaughter / psara.git’ set:deploy_to,’/ home / Psara / Psara’ set:default_run_options,:pty => true […]

rake退出状态:139

我关注https://gorails.com/deploy/ubuntu/16.04 我正在运行:“捆绑exec cap生产部署”并收到以下错误: 01 $HOME/.rbenv/bin/rbenv exec bundle install –path /home/deploy/deploy_test1/shared/bundle –without development test –deployment –q… ✔ 01 deploy@107.170.84.18 3.251s 00:21 deploy:assets:precompile 01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile 01 /home/deploy/deploy_test1/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.4/lib/active_support/core_ext/numeric/conversions.rb:121: w… 01 /home/deploy/deploy_test1/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.4/lib/active_support/core_ext/numeric/conversions.rb:121: w… 01 bash: line 1: 23934 Segmentation fault (core dumped) $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile (Backtrace restricted to imported tasks) cap […]

在capistrano部署之后运行rails应用程序

部署rails app第一次抛出Capistrano :我在另一台机器(服务器)上部署了我的rails应用程序 rails app的文件结构 ## this is my server akshay@akshay:/var/www/model_demo$ ls current releases repo revisions.log shared cap -T ## showing a lots of rake task 喜欢 cap deploy:migrate # Runs rake db:migrate if migrations are set 如果我执行这项任务,那就不行了 Stage not set, please call something such as `cap production deploy`, where production is a stage you […]

如何在capistrano中存储秘密变量

我正在编写一个使用Capistrano自动部署的Rails应用程序。 在deploy.rb脚本中,我有: set :deploy_to, ‘/my/deploy/path/’ 在production.rb我有: server ‘example.com’, user: ‘secret_user_name’, roles: %w{web app db} 目前该应用程序是私有的。 但假设我想要一个像这样的开源应用程序。 然后我不希望secret_user_name和/my/deploy/path存储在repo中。 在Rails项目中,如果我遇到这样的问题,我会将秘密值存储在secrets.yml并从那里访问它们。 但是我无法访问Capistrano的secrets.yml。 所以我可以手动加载秘密文件,但我确信有更好的方法来做到这一点。 所以我的问题是:如何在不使用Capistrano暴露服务器信息的情况下实现自动部署流程? 是否有推荐的方法来存储Rails中的秘密?

Capistrano 3.0 – 现在如何安全地提示输入密码?

在3.0之前有一种方法可以做到这一点: # … set :mysql_password, proc { Capistrano::CLI.password_prompt “Gimme remote database server password. Don’t worry, I won’t tell anyone: ” } # … namespace :db do desc ‘Dump remote database’ task :dump do run “mysqldump -u #{mysql_user} -p #{mysql_database} > ~/#{mysql_database}.sql” do |channel, stream, data| if data =~ /^Enter password:/ channel.send_data “#{mysql_password}\n” end end end […]

/ usr / bin / env:ln:符号链接的级别太多

这个问题让我感到害怕,我觉得我已经尝试了一切。 首先,升级到Capistrano 3时问题就开始了.Capistrano现在在部署之前在每个命令之前使用/ usr / bin / env,以确保环境设置正确。 当Capistrano创建符号链接到必要的共享目录和相应的文件时,它会尝试以下命令: /usr/bin/env ln -s /full/path /different/full/path …然后它出错了: /usr/bin/env: ln: Too many levels of symbolic links 我意识到这不是Capistrano的错,所以我开始通过ssh’ing到我的服务器进行故障排除并尝试相同的命令,并且我收到相同的错误(至少有利于一致性)。 然后我在没有/ usr / bin / env的情况下尝试相同的命令: ln -s /full/path /different/full/path 它的工作原理!!!! 也许你可以看到我不能的真正解决方案? 这里只是/ usr / bin / env命令的输出: rvm_bin_path=/home/deployer/.rvm/bin GEM_HOME=/home/deployer/.rvm/gems/ruby-1.9.3-p392 TERM=xterm-256color SHELL=/bin/bash IRBRC=/home/deployer/.rvm/rubies/ruby-1.9.3-p392/.irbrc SSH_CLIENT=… OLDPWD=/home/deployer/Sites/example.com MY_RUBY_HOME=/home/deployer/.rvm/rubies/ruby-1.9.3-p392 SSH_TTY=/dev/pts/0 USER=deployer LS_COLORS= ….. _system_type=Linux […]