Tag: capistrano

缺少当前文件夹Capistrano Rails 3.2

我需要理解为什么capistrano不会创建当前的文件夹。 我正在使用以下命令:cap deploy:setup,cap deploy:check,cap deploy 但是,当我检查我的应用程序目录时,我不是当前文件夹。 这是我的deploy.rb # Execute “bundle install” after deploy, but only when really needed require ‘bundler/capistrano’ # Automatically precompile assets load “deploy/assets” # RVM integration require “rvm/capistrano” # Application name set :application, “app” # Application environment set :rails_env, :production # Deploy username and sudo username set :user, “ubuntu” default_run_options[:pty] = true […]

自动将文件部署到Amazon S3?

我有一个Rails项目,我将部署到非常棒的Heroku 。 我真的希望能够自动将我的资源自动推送到Amazon S3,在这种情况下资源是我的图像,样式表和javascript。 显然我可以自己写一些capistrano任务,但是有没有人知道这样做的事情呢? 注意:我不需要能够将用户文件上传到S3,因为我已经通过paperclip上传了这些文件。 我在谈论运行该站点所需的实际项目文件。

部署期间Capistrano’Bundle Not Found’错误

当我运行cap deploy:update我得到下面的错误,表明找不到bundle 。 当我从cap shell运行echo $PATH ,缺少包含bundle的/var/lib/gems/1.9.1/bin路径,但是这个路径在/etc/profile和~/.bashrc 。 有谁知道如何解决这个问题? [192.168.10.100] executing command *** [err :: 192.168.10.100] sh: *** [err :: 192.168.10.100] bundle: not found *** [err :: 192.168.10.100] command finished in 25ms failed: “sh -c ‘bundle install –gemfile /data/www/apps/my_app/releases/201104 04163717/Gemfile –path /data/www/apps/my_apps/shared/bundle –deployment –qui et –without development test'” on 192.168.10.100

带有符号链接的mod_xsendfile

我正在使用xsendfile和我的Rails 3应用程序遇到问题。 我使用capistrano来管理部署,在每个版本中,都有一个指向shared / assets目录的符号链接(例如/ var / www / site / releases / 1234 / assets => / var / www / site / shared / assets )。 问题是XSendFile似乎没有遵循符号链接。 在我的apache日志中,我看到以下错误: The given path was above the root path: xsendfile: unable to find file: /var/www/site/releases/20110406205607/assets/pdfs/2/original/test.pdf 我将XSendFilePath配置设置为 XSendFilePath /var/www/site/shared/assets 如果我将配置切换到: XSendFilePath /var/www/site/releases 一切正常。 所以我有几个问题: 1)有没有办法让XSendFilePath跟随符号链接? 2)将XSendFilePath设置为我的发行版dir是否存在安全风险? 换句话说,我是否打开了对所有dir的访问权限?

Capistrano没有这样的文件加载 – 部署

当我尝试运行任何cap命令时,我得到一个“没有这样的文件加载 – 部署”错误。 这是输出: Tylers-MacBook-Pro:cap_app Tyler$ cap -T /Users/Tyler/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’: no such file to load — deploy (LoadError) from /Users/Tyler/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/configuration/loading.rb:152:in `require’ from Capfile:1:in `load’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/configuration/loading.rb:93:in `instance_eval’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/configuration/loading.rb:93:in `load’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/configuration/loading.rb:172:in `load_from_file’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/configuration/loading.rb:89:in `load’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/configuration/loading.rb:86:in `block in load’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/configuration/loading.rb:86:in `each’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/configuration/loading.rb:86:in `load’ from /Users/Tyler/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.11.0/lib/capistrano/cli/execute.rb:65:in `block in load_recipes’ […]

Capistrano和GitHub Private Repo – 许可被拒绝(公钥)

我inheritance了一个在Linode上托管的Rails项目。 之前的开发人员使用BitBucket存储库以及Capistrano进行部署。 我已经在GitHub上设置了一个私有存储库,我正试图让Capistrano的配方工作。 我没有运气。 我在部署期间继续收到publickey错误。 以下是我采取的步骤 – 更新了Linode服务器上的Git远程(源)URL以指向我的新存储库 更新了Capfile中的存储库引用,以引用我的新存储库 确保在ssh_options[:forward_agent]设置为true 在本地生成SSH密钥(id_rsa.pub)并将其添加到GitHub中的用户帐户 执行ssh-add命令,以确保为auth代理添加了标识 跑ssh -T git@github.com确认ssh在本地正确设置 登录到我的Linode服务器并运行ssh -T git@github.com以确保它也正常工作 另外,为了防止forward_agent属性不起作用,我甚至尝试在Linode服务器上生成SSH密钥,并将其添加到GitHub。 没运气。 完成所有这些后,当我运行cap deploy ,我收到以下错误: Permission denied (publickey). fatal: The remote end hung up unexpectedly 以下是我正在使用的食谱 – require “bundler/capistrano” server “—-SERVER IP—-“, :web, :app, :db, primary: true set :application, “blog” set :user, “deployer” set :deploy_to, “/var/www/blog” set […]

Capistrano 3,Rails 4,数据库配置没有指定适配器

当我开始 上限生产部署 它失败了: DEBUG [4ee8fa7a] Command: cd /home/deploy/myapp/releases/releases/20131025212110 && (RVM_BIN_PATH=~/.rvm/bin RAILS_ENV= ~/.rvm/bin/myapp_rake assets:precompile ) DEBUG [4ee8fa7a] rake aborted! DEBUG [4ee8fa7a] database configuration does not specify adapter 您可以看到“RAILS_ENV =”实际上是空的,我想知道为什么会发生这种情况? 我假设这是后一个错误的原因,我没有数据库配置。 deploy.rb文件如下: set :application, ‘myapp’ set :repo_url, ‘git@github.com:developer/myapp.git’ set :branch, :master set :deploy_to, ‘/home/deploy/myapp/releases’ set :scm, :git set :devpath, “/home/deploy/myapp_development” set :user, “deploy” set :use_sudo, false set […]

Capistrano:my.server.ipadress上不存在链接文件database.yml

在我尝试通过capistrano将我的应用程序部署到我的服务器后,我收到以下错误消息: DEBUG [605f198a] Finished in 0.084 seconds with exit status 1 (failed). ERROR linked file /home/deploy/myrailsapp/shared/config/database.yml does not exist on xx.xxx.xx.xxx (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as deploy@xx.xxx.xx.xxx: exit SystemExit: exit Tasks: TOP => deploy:check:linked_files (See full trace by running task with –trace) The deploy has failed with an […]

致命:无法读取“https://github.com”的用户名:没有此类设备或地址

我已经使用github和capistrano将我的Rails 4应用程序部署到Rackspace几周了。 一切正常,直到我最终使我的存储库私有化。 现在,我在运行’cap deploy’后收到以下错误: “致命:无法读取’ https://username@github.com ‘的密码:没有这样的设备或地址” 下面是我的deploy.rb文件中的代码 set :application, “appname” set :repository, “https://git_username@github.com/git_username/appname.git” set :scm, :git set :scm_username, “git_username” set :scm_passphrase, “git_password” set :scm_command, “git” set :keep_releases, 5 set :branch, “master” set :rails_env, “production” set :deploy_to, “/var/www/doLocal” set :user, “deployer” set :password, “deployer_password” set :use_sudo, false ssh_options[:forward_agent] = true server “/path/to/server”, :app, :web, […]

如何修改capistrano deploy以在Rails 3.0中自动运行迁移

现在,我必须运行cap deploy和cap deploy:如果要运行迁移,则需要进行迁移。 我如何修改cap deploy任务以运行迁移。