Tag: capistrano

Capistrano自定义任务失败,因为“Rails需要RubyGems> = 1.3.2”

我的自定义capistrano任务“app:sample”失败,并显示以下错误消息: mnylen ilmo-on-rails $ cap app:sample * executing `app:sample’ * executing “export RAILS_ENV=production; cd /home/mnylen/ilmo-on-rails/current; ruby script/coursegen 10” servers: [“rails.cs.helsinki.fi”] * establishing connection to gateway `melkinpaasi.cs.helsinki.fi’ * Creating gateway using melkinpaasi.cs.helsinki.fi * establishing connection to `rails.cs.helsinki.fi’ via gateway Password: [rails.cs.helsinki.fi] executing command *** [err :: rails.cs.helsinki.fi] Rails requires RubyGems >= 1.3.2. Please install RubyGems and […]

Capistrano在ssh登录后更改用户 – 作为另一个用户部署

在我的staging.rb文件中,我需要连接“ubuntu”用户名 server ‘**.**.****.**’, user: ‘ubuntu’, roles: %w{web app db} 在我的deploy.rb中 set :deploy_to, -> { “/var/www/myuser/myuser.com/capi” } 服务器 var/www/myuser/myuser.com# ls -la total 32 drwxrwx— 8 myuser myuser 4096 Jul 9 14:54 . drwxrwx— 5 myuser myuser 4096 Feb 26 17:18 .. drwxrwx— 7 myuser myuser 4096 May 7 13:48 beta drwxr-xr-x 2 myuser myuser 4096 Jul […]

每当Gem无法在Capistrano中正确运行“捆绑执行”

我在使用Capistrano将Whenever gem部署到我的生产环境时遇到了问题。 这个问题源于一个bundle exec whenever命令触发一些’缺少gem’问题(但是从shell运行bundle install会显示事实上一切都在那里!)。 我的感觉是发生了两件事之一:Bundler在调用bundle exec之前没有完全加载,或者某种程度上存在一个在错误的地方运行它的路径问题。 这是发生了什么: * executing `deploy’ * executing `deploy:update’ ** transaction: start * executing `deploy:update_code’ executing locally: “git ls-remote git@my-source-repository:mysource.git HEAD” command finished in 1847ms * executing “git clone -q git@my-source-repository:mysource.git /domains/myapp/releases/20130124211036 && cd /domains/myapp/releases/20130124211036 && git checkout -q -b deploy 90238bbcb993e3e7df2374ffaa13e7ed701c202e && (echo 90238bbcb993e3e7df2374ffaa13e7ed701c202e > /domains/myapp/releases/20130124211036/REVISION)” servers: [“myip”] […]

如何让Capistrano 3使用RVM ruby​​?

的Gemfile: gem ‘capistrano’, ‘~> 3.0.0’ gem ‘capistrano-rails’ gem ‘capistrano-bundler’ gem ‘capistrano-rvm’ gem ‘capistrano3-puma’ Deploy.rb: set :rvm_type, :user set :rvm_ruby_version, ‘2.1.1’ set :default_env, { rvm_bin_path: ‘~/.rvm/bin’ } Production.rb namespace :rails do desc “Open the rails console on primary app server” task :console do on roles(:app), primary: true do execute_interactively “#{current_path}/script/rails console RAILS_ENV=production” end end def execute_interactively(command) […]

Rails 3.1和Asset Pipeline:使用Capistrano进行部署时出现问题

我刚刚从Ruby on Rails 3.0.10切换到3.1.0,我想通过使用Capistrano gem来部署我的资产文件(我的本地机器是运行Snow Leopard的MacO,我的远程机器运行的是Ubuntu 10.04 Lucid)。 因此,正如官方指南中所写,我在我的Capfile取消注释load ‘deploy/assets’ ,如下所示: # Uncomment if you are using Rails’ asset pipeline load ‘deploy/assets’ 现在,当我运行cap deploy命令时,我收到以下错误(错误在底部解释): … * executing “cd //releases/20110925223032 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile” servers: [“”] [] executing command ** [out :: ] (in //releases/20110925223032) *** [err :: ] rake aborted! *** [err :: ] […]

使用via:remote_cache使用Capistrano + Gitlab进行部署

我使用capistrano来部署PHP Web应用程序,我们有一个内部gitlab服务器,无法在网络外部访问。 我正在尝试使用remote_cache进行部署,因为如果将其用于复制需要很长时间。 我已经检查了这个和这个但没有得到想要的结果。 我正在尝试下面的代码。 set :default_stage, “staging” ssh_options[:forward_agent] = true server “servername”, :app, :web, :db, :primary => true set :application, “appname” set :scm, :git set :repository, ‘.’ set :local_repository, “file://.” set :branch, “master” default_run_options[:pty] = true set :keep_releases, 2 set :user, ‘username’ set :deploy_to, “/home/domain/public_html/test” set :copy_cache, true set :deploy_via, :remote_cache set :copy_strategy, :export […]

从capistrano任务中调用多级capistrano任务

我有一个capistrano任务,它整合了Rails项目的多个阶段的部署。 例如: task :consolidated_task do build #creates a new release branch from master, #sets a variable with the relese branch name staging deploy.migrations production deploy.migrations end 这是从另一个上限任务调用多阶段任务的正确方法吗? 构建任务创建一个新的git分支并发布它。 新分支的名称将保存为capistrano变量。 然后,登台和生产阶段任务使用此变量来指定要部署的分支。 当此任务运行时,它会失败: fatal: working tree ‘/Users/’ already exists. /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy/strategy/copy.rb:99:in `initialize’: No such file or directory – /var/folders/3d/3dKYNUwQGOSLZFXsMF-uv++++TM/-Tmp-/20100802182750/REVISION (Errno::ENOENT) 我正在从我的本地机器推送源代码作为git存储库,并且部署机器无法相互通信。

使用Capistrano在Dreamhost上部署Rails 3

我正在尝试使用Capistrano部署Rails应用程序(这是我第一次使用Capistrano)。 我有一个使用Ruby 1.8.7和Rails 3.0.3的Dreamhost私有服务器(根据http://rails.dreamhosters.com/ ) 我已经按照Dreamhost的Capistrano安装说明(http://wiki.dreamhost.com/Capistrano) 当我运行“cap deploy:migrations”时,我收到此错误: [out :: xxx.com] Could not find i18n-0.5.0 in any of the sources ** [out :: xxx.com] Try running `bundle install` 我是否认为在部署时,捆绑安装应该自动运行? 不完全确定i18n来自哪里,因为我没有在任何地方添加它。 有没有人经历过这个或者有任何经验将Rails 3部署到Dreamhost?

Cap deploy – 错误:找不到存储库

我inheritance了一个项目并且对开发方面很满意,但是系统性能差,而且Capistrano部署失败了。 对于之前由开发人员部署过的项目: cap deploy:check 运行良好,导致 You appear to have all necessary dependencies installed 但是当我尝试部署时,我得到了 … ERROR: Repository not found. … 我有: Triple检查了github repo地址 确认我可以从本地机器上的回购推送和拉动 确认我可以通过SSH从服务器连接到github 确认我可以在服务器上克隆repo 试图打开和关闭代理转发 确认repo路径匹配.git / config和config / deploy.rb 此时,当代理转发时,来自服务器的SSH进入github将返回前一个dev的信息,该开发者仍然可以访问github repo。 Hi xxxxxx! You’ve successfully authenticated, but GitHub does not provide shell access. 启用代理转发时,我将显示为已通过身份validation的用户。 解决这个问题的任何提示? 对于通过排除故障进行排序的正常URL非常高兴。

capistrano回滚是否会撤消迁移?

我是新手。 我有一个生产服务器,需要从github部署最新版本的应用程序,所以我使用的是Capistrano。 最新版本对数据库进行了一些更改,因此进行了大量迁移,因此我将使用deploy:migrate进行部署。 所以我的问题是,如果我将一些数据添加到创建的新列中(它不会更改表中的任何现有列,只创建新的表和列)然后想要回滚,那么将限制部署:rollback reverse所有的迁移也是如此? 是否删除了这些新列中的数据并将数据库恢复到以前的状态(假设除了数据库中的新增内容之外我没有进行任何数据更改)? 谢谢!