Tag: 部署

如何在自定义capistrano任务中使用事务?

我正在编写一个自定义的capistrano任务来缩小我的javascripts,并希望通过回滚部署来处理缩小失败的情况。 我一直在阅读文档,并认为我已经想出如何做到这一点,但它不适合我。 这就是我所拥有的: desc ‘Minify all javascript files’ task :bundle, :roles => :app, :except => { :no_release => true } do on_rollback do run “rm #{current_path}/public/javascripts/all.js” puts “ROLLBACK” end transaction do run “cd #{current_path}; RAILS_ROOT=#{current_path} rake bundle:js” end end after ‘deploy:update’, ‘deploy:bundle’ 当我运行cap staging deploy:bundle并将其设置为失败时,我得到以下输出: triggering start callbacks for `staging’ * executing `staging’ triggering start […]

生产轨道部署中的两个版本的gem

我认为我的生产中的gemfile存在一些问题,因为它与我的开发不同,我认为这导致我的部署(Capistrano)失败,至少在捆绑安装时间 发展 actionmailer (3.2.3) actionpack (3.2.3) activemodel (3.2.3) activerecord (3.2.3) activeresource (3.2.3) activesupport (3.2.3) arel (3.0.2) bcrypt-ruby (3.0.1) builder (3.0.4) bundler (1.3.4) capistrano (2.14.2, 2.12.0) climate_control (0.0.3) cocaine (0.5.1, 0.2.1) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.6.2, 1.3.3) commonjs (0.2.6) daemon_controller (1.1.2, 1.0.0) daemons (1.1.9) database_cleaner (0.9.1, 0.8.0) devise (2.2.3) diff-lcs (1.2.2, 1.1.3) erubis (2.7.0) eventmachine […]

Rails 4 Unicorn服务应用程序没有ActiveRecord

我正在构建一个不使用任何数据库的rails 4应用程序。 我已经在我的开发机器上成功禁用了ActiveRecord,方法是在线删除database.yml并替换几个指南 require ‘rails/all’ 同 require “action_controller/railtie” require “action_mailer/railtie” require “rails/test_unit/railtie” require “sprockets/railtie” 它在本地工作,但是当我尝试在运行独角兽的服务器上部署它时,我在错误日志上得到了这个 ERROR — : ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) /home/rtb/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection’ 当我启用了database.yml和activerecord时,应用程序在生产的unicorn服务器上工作正常。 有什么我想念的吗?

Heroku预编译资产失败

更新后,我的应用程序突然无法运行。 不确定出了什么问题。 基本上,当我推送到heroku时,我得到这些错误: Precompiling assets failed, enabling runtime asset compilation Injecting rails31_enable_runtime_asset_compilation 再高一点: rake aborted! Unexpected token: operator (>) (line: 19073, col: 9, pos: 605247) Error at new JS_Parse_Error (/tmp/execjs20121211-811-1z5vum.js:1720:22) at js_error (/tmp/execjs20121211-811-1z5vum.js:1728:15) at croak (/tmp/execjs20121211-811-1z5vum.js:2189:17) at token_error (/tmp/execjs20121211-811-1z5vum.js:2196:17) at unexpected (/tmp/execjs20121211-811-1z5vum.js:2202:17) at /tmp/execjs20121211-811-1z5vum.js:2580:17 at maybe_unary (/tmp/execjs20121211-811-1z5vum.js:2665:27) at expr_op (/tmp/execjs20121211-811-1z5vum.js:2685:45) at expr_ops (/tmp/execjs20121211-811-1z5vum.js:2692:24) at maybe_conditional […]

使用capistrano部署rails应用程序时的符号链接警告

在尝试使用capistrano部署我的rails应用程序时,我感到很困惑。 警告如下:[弃用警告]此API已更改,请挂钩部署:create_symlink而不是deploy:symlink 任何人都可以向我解释一下卡斯特拉诺试图做什么吗? 以及如何解决这个问题? 任何帮助都会非常感激! 哦,这是我的部署文件。 $:.unshift(File.expand_path(‘./lib’, ENV[‘rvm_path’])) # Add RVM’s lib directory to the load path. require “rvm/capistrano” # Load RVM’s capistrano plugin. set :application, “Project” set :scm, “git” set :repository, “ssh://git@server.project.ca/usr/local/git_root/project.git” set :user, “deploy” #set :rvm_bin_path, “/usr/local/rvm/bin” set :rvm_ruby_string, “ruby-1.9.2-p290@project” set :normalize_asset_timestamps, false ssh_options[:forward_agent] = true set :branch, “master” set :deploy_via, :remote_cache set […]

如何在Elastic Beanstalk上设置delayed_job时修复’require’错误

我无法在Elastic Beanstalk上运行delayed_jobs。 我正在使用运行Ruby 2.1(乘客独立)容器的64位Amazon Linux 2014.03 v1.0.0 。 这是我的配置脚本(delayed_job.config)…… files: “/opt/elasticbeanstalk/hooks/appdeploy/post/99_restart_delayed_job.sh”: mode: “000755” owner: root group: root encoding: plain content: | #!/usr/bin/env bash . /opt/elasticbeanstalk/support/envvars cd $EB_CONFIG_APP_CURRENT su -c “RAILS_ENV=production bin/delayed_job –pid-dir=$EB_CONFIG_APP_SUPPORT/pids restart” $EB_CONFIG_APP_USER 99_restart_delayed_job.sh脚本存在并运行……但后来我99_restart_delayed_job.sh了这个错误。 2014-10-02 15:28:32,332 [INFO] (17387 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded. 2014-10-02 15:28:32,402 [INFO] (17448 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] […]

Capistrano部署 – 资产预编译错误

我正在与Capistrano一起部署到我的新VPS。 在第一次部署(上限部署)之后,一切正常(站点正在运行),但第二次部署在资产上失败:预编译错误。 我正在运行rails 3.2.13,ruby 2.0.0,rvm。 错误: * executing “cd — /home/rails/releases/20140116121250 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile” servers: [“IP”] [IP] executing command *** [err :: IP] bash: line 1: 23406 Killed RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile command finished in 84187ms *** [deploy:update_code] rolling back * executing “rm -rf /home/rails/releases/20140116121250; true” servers: [“IP”] [IP] […]

为什么我在capistrano生成的文件部署中获得Permission denied错误?

我遇到了failed: “sh -c ‘cd /var/www -c’cd failed: “sh -c ‘cd /var/www错误。然后通过在deploy.rb中添加以下内容来修复它… set :default_environment, { ‘PATH’ => “/var/lib/gems/1.9.1/bin:$PATH” } 现在我收到了这个新错误。 ** [out :: ip.address] Rails Error: Unable to access log file. Please ensure that /var/www/releases/20111208152807/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the […]

Heroku部署的应用程序错误

我正在Heroku上部署一个网站,但是当我尝试运行“heroku open”时,我收到了“应用程序错误”。 我相信我已成功将文件推送到Heroku,这是我的“git push heroku master”代码的一部分: —–> Ruby/Rails app detected —–> Using Ruby version: ruby-1.9.3 —–> Installing dependencies using Bundler version 1.3.2 Ruby version change detected. Clearing bundler cache. Old: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] New: ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux] Running: bundle install –without development:test –path vendor/bundle –binstubs vendor/bundle/bin –deployment 当我运行“heroku config […]

Capistrano无法在应用程序部署中找到Gemfile错误

我正在尝试将我的Rails应用程序部署到生产服务器,我决定使用本指南 + RVM将其部署到DigitalOcean。 要部署我使用以下命令: cap production deploy 但是,它在某些需要gemfile的部分失败了。 这是部署失败的日志: DEBUG[323dfd0e] Command: cd /home/deploy/zwiadowcy/releases/20140628164657 && ~/.rvm/bin/rvm default do bundle install –binstubs /home/deploy/zwiadowcy/shared/bin –path /home/deploy/zwiadowcy/shared/bundle –without development test –deployment –quiet DEBUG[323dfd0e] Could not locate Gemfile cap aborted! SSHKit::Runner::ExecuteError: Exception while executing on host my_ip_address: bundle exit status: 10 bundle stdout: Nothing written bundle stderr: Nothing written 我的gemfile已包含所有必需的东西: […]