主に価格が理由で、HerokuではなくDigitalOceanに初めてレールアプリをデプロイしようとしています。私はCapistranoとVPSの展開にまったく慣れておらず、完全に迷っています。1-click-Rails-droplet を作成し、次のチュートリアルに従いました: http://guides.beanstalkapp.com/deployments/deploy-with-capistrano.html
これは私の deploy.rb ファイルの設定です:
require 'capistrano/ext/multistage'
set :stages, ["staging", "production"]
set :default_stage, "staging"
set :application, "myAppName"
set :scm, :git
set :repository, "myGitRepository"
set :use_sudo, :false
set :deploy_via, :remote_cache
set :scm_passphrase, "myPassword"
set :user, "root"
role :web, "xx.xxx.x.xxx"
role :app, "xx.xxx.x.xxx"
staging.rb ファイル:
server "xx.xxx.x.xxx", :app, :web, :db, :primary => true
set :deploy_to, "/var/www/xx.xxx.x.xxx_staging"
そして production.rb ファイル
server "xx.xxx.x.xxx", :app, :web, :db, :primary => true
set :deploy_to, "/var/www/xx.xxx.x.xxx"
今、私が走るとき
cap deploy:check
ターミナルでは、次のようになります。
[xx.xxx.x.xxx] executing command
xx.xxx.x.xxx: env:
xx.xxx.x.xxx: sh
xx.xxx.x.xxx: : No such file or directory
xx.xxx.x.xxx:
command finished in 88ms
* executing "test -w /var/www/xx.xxx.x.xxx_staging"
servers: ["xx.xxx.x.xxx"]
[xx.xxx.x.xxx] executing command
xx.xxx.x.xxx: env:
xx.xxx.x.xxx: sh
xx.xxx.x.xxx: : No such file or directory
xx.xxx.x.xxx:
command finished in 79ms
* executing "test -w /var/www/xx.xxx.x.xxx_staging/releases"
servers: ["xx.xxx.x.xxx"]
[xx.xxx.x.xxx] executing command
xx.xxx.x.xxx: env:
xx.xxx.x.xxx: sh
xx.xxx.x.xxx: : No such file or directory
xx.xxx.x.xxx:
command finished in 72ms
* executing "which git"
servers: ["xx.xxx.x.xxx"]
[xx.xxx.x.xxx] executing command
xx.xxx.x.xxx: env:
xx.xxx.x.xxx: sh
xx.xxx.x.xxx: : No such file or directory
xx.xxx.x.xxx:
command finished in 85ms
* executing "test -w /var/www/xx.xxx.x.xxx_staging/shared"
servers: ["xx.xxx.x.xxx"]
[xx.xxx.x.xxx] executing command
xx.xxx.x.xxx: env:
xx.xxx.x.xxx: sh
xx.xxx.x.xxx: : No such file or directory
xx.xxx.x.xxx:
command finished in 81ms
The following dependencies failed. Please check them and try again:
--> `/var/www/xx.xxx.x.xxx_staging/releases' does not exist. Please run `cap staging deploy:setup'. (xx.xxx.x.xxx)
--> You do not have permissions to write to `/var/www/xx.xxx.x.xxx_staging'. (xx.xxx.x.xxx)
--> You do not have permissions to write to `/var/www/3xx.xxx.x.xxx_staging/releases'. (xx.xxx.x.xxx)
--> `git' could not be found in the path (xx.xxx.x.xxx)
--> `/var/www/xx.xxx.x.xxx_staging/shared' is not writable (xx.xxx.x.xxx)
私は長い間グーグルで検索しましたが、これを修正できません。私はこれにまったく慣れていないので、Rails アプリの作成方法を学ぶことと、それらのデプロイに関するすべてのことを知ることの間には大きなギャップがあるように感じます (ところで、以前の ftp アップロードはどうなったのでしょうか?)、誰かが知っていることを本当に願っています。これを修正する方法と、展開の学習曲線がそれほど急ではない方向に私を導くことができます。ところで、私がやろうとしていることを行うための「より簡単な」方法はありますか? どうもありがとうございました!
編集:もう1つの質問:サーバーへの途中でgithubにアプリをデプロイする必要がありますか?