Tag: capistrano

在尝试使用capistrano进行部署时,为什么会出现Psych错误?

我目前正在我的Rails 3.2.13应用程序中设置capistrano。 我收到以下错误/详细信息(包括“第1行第1列不允许使用控制字符”)。 我已经做了一些搜索,但没有看到任何与我有关的事情。 我正在使用rvm-capistrano和ruby 2.0.0-p195。 我最近将我的应用程序所需的环境变量移动到.bashrc中。 … * 2013-06-10 15:18:32 executing `deploy:assets:update_asset_mtimes’ * executing “[ -e /home/deployer/apps/super_rad_app/shared/assets/manifest* ] && cat /home/deployer/apps/super_rad_app/shared/assets/manifest* || echo” servers: [“107.20.249.163”] [107.20.249.163] executing command command finished in 6238ms *** [deploy:update_code] rolling back * executing “rm -rf /home/deployer/apps/super_rad_app/releases/20130610221258; true” servers: [“107.20.249.163”] [107.20.249.163] executing command ** [out :: 107.20.249.163] Using /home/deployer/.rvm/gems/ruby-2.0.0-p195 command […]

我如何使用冷冻Capistrano第2部分?

继我几天前使用冷冻Capistrano的问题之后,我仍然遇到在我的供应商文件夹中运行Capistrano的问题。 当我尝试运行我的冷冻版帽 ruby -r rubygems ./vendor/gems/capistrano-2.5.2/bin/cap deploy-with-migrations 我收到一个错误 … RubyGem version error: net-ssh(1.0.8 not >= 2.0.0) (Gem::LoadError) … 我在我的供应商文件夹中冻结了net-ssh-2.0.4,因为我知道它是一个依赖项,所以我该如何使用它呢? 我希望将我的供应商文件夹添加到gempath下的.gemrc文件中:本来可以做到这一点,但事实并非如此。 ‘gem environment’显示供应商路径,但’gem list’不显示vendor文件夹中的gem。 有任何想法吗?

使用nginx,passenger和capistrano部署Rails应用程序

我正在部署我的第一个rails应用程序。 我这样做有些麻烦。 我将描述我到目前为止所做的事情。 1)我通过gorails.com正确配置了所有内容 2)我正在尝试将其部署在Digital Ocean上 3)我进行了cap deploy production ,最终结果成功,中间有一些失败。 4)我启动了nginx服务器 5)在我的浏览器中它给了我500错误。 6)我检查了我的production.log ,它显示了它运行的所有迁移和种子。 它完美地创建了表格(正如我在我的数据库中检查过的那样)。 7)我检查了nginx error.log ,结果显示index.html缺失。 8)所以为了检查,我在公共目录中添加了index.html文件,浏览器正确显示了内容。 9)但是我的登陆页面是家庭控制器中的index.html.erb,所以在路径文件中我做了一些修改但是浏览器的输出没有变化。 10)我注意到error.log和production.log没有立即更新。 我不知道为什么。 11)我需要帮助让nginx显示我的index.html.erb文件并将其与rails app连接。 数据库配置正确。 12)我的nginx配置文件是: server { listen 80 default_server; server_name digital_ocean_ip; passenger_enabled on; rails_env production; root /home/myapp/myapp/current/public; # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; […]

capistrano 3 + rvm1-capistrano3 rails 4.1 secrets.yml环境变量问题

我一直在使用capistrano 3部署rails 4.1应用程序。它一直工作正常。 但是当我尝试做rake任务时(取消注释需要’capistrano / rails / assets’)。 我收到这个错误 cap aborted! SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx.xxx.xxx: rake exit status: 1 rake stdout: Nothing written rake stderr: config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly: * development – set it to false * test – set it to false (unless you […]

通过capistrano(&rvm)部署时出现捆绑安装错误

现在我必须承认,就这个部署百灵而言,我在黑暗中磕磕绊绊。 我会尽力解释这种情况; 我已经设置了一个测试部署服务器,并尝试使用capistrano将我的应用程序部署到它,但是,我遇到了一些围绕我的gem及其依赖关系的困难,如下面的错误。 [mike-test] executing command [mike-test] rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell ‘1.9.3’ -c ‘cd /home/deploy/myapp/releases/20120910081544 && bundle install –gemfile /home/deploy/myapp/releases/20120910081544/Gemfile –path /home/depoy/myapp/shared/bundle –deployment –quiet –without development test’ ** [out :: mike-test] Some gems seem to be missing from your vendor/cache directory. ** [out :: mike-test] Could not find log4r-1.1.10 in any of the sources command finished in […]

在生产中更新了Ruby,现在Rails将无法启动,因为仍然引用旧的ruby

刚刚通过RVM在登台服务器上更新了Ruby: $ rvm upgrade 1.9.3-p327 1.9.3-p362 我对所有迁移和别名问题说“是”,包括删除旧的Ruby。 现在,每当我尝试访问Rails应用程序时,都会从Passenger获取错误: Error message: dlopen(/Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle, 9): Library not loaded: /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/libruby.1.9.1.dylib Referenced from: /Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle Reason: image not found – /Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle 我已经重新安装了Passenger ……并且还使用稍微更新的Gemfile运行了cap deploy 。 但似乎仍有一些旧Ruby的引用。 这里发生了什么以及如何更新或重新编译,以便gem等引用新的Ruby? 是否有一些我可以在Capistrano中指定的标志会强制重新编译gem(假设这是问题)? 编辑(添加一些RVM信息): 我在这台服务器上使用RVM的“多用户”安装,因此gem安装在: /Library/WebServer/rails/popup/shared/bundle/ruby/1.9.1/gems gems而不是我的位置可能已经预料到了它们: /usr/local/rvm/rubies/ruby-1.9.3-p362/lib/ruby/gems/1.9.1/gems 。 从来没有真正理解RVM在多用户安装中所做的事情,但它已经奏效了。 因此,我不能真正$ rvm gemset use myapp然后bundle install因为我认为不会安装在正确的目录中。 这是Capistrano在bundle install任务期间的输出: * 2013-01-03 19:23:22 executing `bundle:install’ * executing “cd […]

在capistrano部署期间键入错误:安装

我花了大约三个星期试图追查这个错误,所以请原谅我,如果这是一个愚蠢的问题,但我完全失去了。 我正在努力弄清楚为什么我不能部署这个应用程序。 当我尝试部署时出现类型错误:setup and deploy:check with capistrano,我无法弄清楚它可能来自哪里。 我认为这可能是我在设置我的ssh键时犯的错误。 但是,当我通过命令行ssh到服务器时,ssh密钥设置显然正常工作。 我正在使用ruby-1.9.2-p290,Rails 3.1.3,rvm 1.10.2,capistrano 2.5.2,Mac OS 10.6.8,我正在部署到运行phusion乘客的朋友服务器。 到目前为止,我们已经尝试切换到ruby 3.1,然后回到1.9.2,重新安装rvm,重新安装phusion乘客,删除和重新创建gemsets等。 预先感谢您提供的任何帮助! 我的整个项目现在已经搁置了太久了! 如果有任何进一步的信息有用,请告诉我。 谢谢! 以下是我运行deploy时发生的情况:使用我的项目文件夹中的capistrano进行设置: $ cap deploy:setup *执行`deploy:setup’*执行“mkdir -p /usr/local/www/sites/myapp.nullpointer.ca/public/> /usr/local/www/sites/myapp.nullpointer.ca / public / releases> /usr/local/www/sites/myapp.nullpointer.ca/public/shared> /usr/local/www/sites/myapp.nullpointer.ca/public/shared/system> / usr / local / www / sites / myapp.nullpointer.ca / public / shared / log> /usr/local/www/sites/myapp.nullpointer.ca/public/shared/pids&& chmod g + […]

尝试将Rails 4应用程序部署到WebFaction,使用他们的文档并在本地获取错误

我试图通过github将一个Rails 4应用程序部署到Webfaction,通过Capistrano 2.15.5。 最初我安装了Capistrano 3并且遇到了错误,所以我最终安装了Capistrano 2.15.5并在此处关注了webfaction的文档: 我采访了webfaction,他们建议我尝试使用旧的Cap 2版本,因为这是他们熟悉的内容,并且不会为Capistrano 3更新他们的文档一段时间。 我在他们的教程中完成了所有适当的步骤,在尝试运行“cap deploy:setup”或“cap deploy:check”等时出现了一堆错误。 pastebin中的错误, 这里 :(如下所示) /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require’: cannot load such file — capistrano/setup (LoadError) from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require’ from Capfile:6:in `load’ from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `instance_eval’ from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `load’ from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:180:in `load_from_file’ from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:89:in `load’ from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `block in load’ from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `each’ from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `load’ from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in […]

Capistrano分段部署需要全新的数据库迁移

我让Capistrano设置为允许我将我的Ruby on Rails网站的暂存版本从git存储库成功部署到amazon服务器。 但是,在部署之后,我必须在服务器上的数据库上运行迁移。 如果不这样做,则无法加载任何包含登录表单或基于数据库的内容的页面。 当我在服务器上运行迁移时,我会看到正在迁移的网站上的每个单独迁移,而不仅仅是最近的迁移。 我知道Capistrano可以保持以前的迁移,我认为它会自动完成。 我的问题是,如何阻止明显的数据库擦除或丢失,以便只有在实际有新的迁移时才需要迁移? 我看到Capistrano输出中没有exception错误,而且对于Capistrano和数据库我是新手。 我注意到我的database.yml文件没有用于登台的条目,我想知道它是否可以像添加数据库设置为db / development.sqlite3的登台条目一样简单? 这是我的deploy.rb文件: set :application, “staging” set :scm, :git set :repository, “.” set :deploy_via, :copy #set :copy_cache, true set :copy_exclude, [“.git”] set :user, “username” set :use_sudo, false default_run_options[:pty] = true server “server_url”, :app, :web, :db, :primary => true set :deploy_to, “/var/www/staging” # if you want […]

如何在capistrano部署后检测孤立的sidekiq进程?

我们有一个Rails 4.2应用程序,它与sidekiq进程一起运行以执行长任务。 不知何故,在几周前的一次部署中,有些事情发生了变化(capistrano部署过程没有有效地阻止它,无法弄清楚原因)并且还有一个孤立的sidekiq进程正在运行,正在与当前的进程竞争redis队列上的作业。 因为这个过程源已经过时,它开始在我们的应用程序上给出随机结果(取决于哪个过程捕获了这个工作),我们得到了非常困难的时间,直到我们想出这个… 我怎么能阻止这种情况再次发生? 我的意思是,我可以在每次部署后运行到VPS并运行ps aux | grep sidekiq ps aux | grep sidekiq检查是否有多个..但它不实用。