Tag: 部署

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

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

Sidekiq部署到多个环境

(请参阅下面的详细配置,这是Henley Chiu回答的结果)。 我一直试图将我的大脑包裹在Sidekiq部署,我并没有真正得到它。 我在同一台服务器上有一个带有暂存环境和生产环境的应用程序。 我所看到的关于sidekiq部署的所有内容基本上都说“只需将sidekiq / capistrano添加到您的部署文件中”,所以我就这样做了。 然后说明是“这里是带有选项的yml文件”,但似乎没有解释。 我需要命名空间吗? 我在初始化文件中看到,但这似乎是指向服务器外部。 我之前部署过,每个阶段似乎都在适当的环境下启动sidekiq,但它们都从相同的队列进行处理。 我的生产电子邮件试图由舞台sidekiq处理,但失败了。 我暂时停止了我的舞台,但最终我还需要再次使用它。 我希望自己不会变得密集,我真的试图理解这一点,并且我很难找到一个明确的“这就是它的完成方式”。 对于它的价值,这里是config / sidekiq.yml(在部署期间加载正常): :concurrency: 5 :verbose: false :pidfile: ./tmp/pids/sidekiq.pid :logfile: ./log/sidekiq.log :queues: – [carrierwave, 7] – [client_emails, 5] – [default, 3] staging: :concurrency: 10 production: :concurrency: 25 日志文件和pid似乎在正确的位置,但队列只是合并。 任何帮助都会很棒! 此外,如果重要: Rails 3.2.11, passenger, nginx, rvm, Ubuntu 12.10, and Ruby 1.9.3 详细配置(答案): […]

每次部署后,Paperclip文件都会被删除

我使用Paperclip gem来存储图片,而在localhost上它可以很好地工作。 但是,我添加到我的实时应用程序的任何图片都会在每次部署后被删除。 我使用Git进行部署。 这是我的部署过程: $ bundle exec cap production deploy $ ssh root@xx.xxx.xx.xxx $ chmod -R 777 /rails_apps/app/releases $ cd /rails_apps/app/current $ cp config/database.yml.sample config/database.yml $ RAILS_ENV=production bundle exec rake assets:precompile $ /etc/init.d/apache2 restart 有没有其他人遇到这样的事情? 更新: 这不是重复,因为这个问题的答案是将此行添加到我的deploy.rb: set :linked_dirs, fetch(:linked_dirs, []).push(‘public/system’) 导致Paperclip完全破裂。 以前我遇到过没有使用Paperclip添加图像的权限的问题,导致此错误: Errno::EACCES in UsersController#update Permission denied – /rails_apps/website/releases/20150807211111/public/system/users/avatars/000/000/562 但是在我的服务器上运行此命令会修复权限: chmod -R 777 […]

将rails部署到heroku – 未经授权的公钥访问

所以我正在尝试将我的应用程序部署到heroku,但每当我推动掌握它时它会一直给我这个错误: ! Your key with fingerprint cb:e1:5c:31:cd:6b:78:6e:30:ff:eb:11:e2:4b:2e:b3 is not authorized to access smooth-mountain-8970. 我尝试了从生成新的ssh密钥到删除所有内容和替换文件的所有内容。 我甚至创建了一个不同的用户名并尝试上传,但它一直给我这个错误,认为我想上传到平滑山,实际上,我的应用名称不是光滑的山。 你们知道问题可能是什么吗? 谢谢。

生产中的Rails错误,可能是由于link_tag和预编译

我在ubuntu 10.04上安装了带有apache2和passenger rails 3.1 。 使用带有RVM ruby 1.9.2 。 当我在生产中的浏览器中加载应用程序(开发版本在我的机器上工作正常)时,它不起作用。 我的生产错误日志是: Started GET “/articles” for 117.230.75.50 at 2011-09-12 13:51:34 +0000 Processing by ArticlesController#index as HTML Rendered articles/index.html.erb within layouts/application (56.4ms) Completed 500 Internal Server Error in 126ms ActionView::Template::Error (application.css isn’t precompiled): 2: 3: 4: Youexpress 5: 6: 7: 8: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__385712067674585148_29380260′ app/controllers/articles_controller.rb:7:in `index’ 但是,当我像这样删除app / […]

使用Capistrano将Rails应用程序部署到多个Web服务器

我目前正在为Rails应用程序设置一个新的生产环境,该应用程序包括多个负载均衡的应用程序服务器(目前只有两个,但随着时间的推移会增加)。 我想使用Capistrano(我已经用于现有的单一服务器)在单个命令中处理应用程序到所有这些服务器的部署。 我能看到这样做的唯一方法是使用capistrano-ext (我实际上已经用它来部署到我的测试和登台环境),为每个应用服务器( app1 , app2等)定义一个新的“环境”并使用以下内容执行部署: cap app1 app2 app3 deploy 这是推荐的做法还是有更好的方法?

Heroku with rails 5错误Gem :: LoadError:为数据库适配器指定’postgresql’

我是Rails的初学者,在部署到Heroku时我看到了一些问题。 之前我使用的是SQLite3,后来当我明白我需要postgresql时,我安装了相同的并在本地机器上工作。 从sqlite迁移到postgresql后,一次部署正常。 现在我看到一些问题。 Heroku日志,Gem文件和Database.yml详细信息如下。 请有人帮助我。 提前谢谢…… !!! Gem文件的一部分: group :development, :test do gem ‘pg’, ‘~> 1.0.0’ gem ‘rails_12factor’ #gem ‘sqlite3’ # Call ‘byebug’ anywhere in the code to stop execution and get a debugger console gem ‘byebug’, platforms: [:mri, :mingw, :x64_mingw] # Adds support for Capybara system testing and selenium driver gem ‘capybara’, ‘~> […]

Capistrano + Git:生产服务器本地的存储库

我正在尝试为我的应用程序“部署:冷”。 git repo对我的部署服务器是本地的(即我只有一台服务器用于所有东西而且我没有在github上托管我的代码)。 这是成绩单(用“myapp”替换我的应用名称以获取隐私) * executing `deploy:cold’ * executing `deploy:update’ ** transaction: start * executing `deploy:update_code’ executing locally: “git ls-remote /home/mrichman/git/myapp.git master” fatal: ‘/home/mrichman/git/myapp.git’ does not appear to be a git repository fatal: The remote end hung up unexpectedly *** [deploy:update_code] rolling back * executing “rm -rf /var/www/myapp.com/releases/20100218203108; true” servers: [“myapp.com”] Password: [myapp.com] executing command […]

安装sqlite3时发生导轨应用程序错误导致Heroku错误,并且Bundler无法继续

我试图将我的rails应用程序推送到heroku并收到如下错误: – Counting objects: 177, done. Delta compression using up to 2 threads. Compressing objects: 100% (161/161), done. Writing objects: 100% (177/177), 44.73 KiB, done. Total 177 (delta 39), reused 0 (delta 0) —–> Heroku receiving push —–> Ruby/Rails app detected —–> Installing dependencies using Bundler version 1.2.1 Running: bundle install –without development:test –path vendor/bundle […]

代码推送到heroku不工作

我想在gihub上的heroku上推送代码 我使用了以下命令 git push heroku mybranch:master 错误是 To https://github.com/user/lyricle-new.git ! [rejected] lyricle-frt-backend -> master (non-fast-forward) error: failed to push some refs to ‘https://github.com/user/app.git’ hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (eg ‘git pull’) before pushing again. hint: […]