capistrano receipesコレクションであるuberspacifyを使用して uberspace.de をテストしています。uberspacifyを開始する前に、 uberspaceが提供するドキュメントの説明に従ってサーバーを構成しました。RubyOnRails アプリがうまく起動しました。uberspacify経由でデプロイしたので、次のエラーが に書き込まれます。/var/www/virtual/john/logs/error_log
[エラー] (111)接続が拒否されました: プロキシ: HTTP: 127.0.0.1:44477 に接続しようとしました (*) 失敗しました
ポート 44477 は、デプロイするたびに異なることに注意してください。
ウェブサイト自体は次のように述べています。
503 Service Temporarily Unavailable
The server is temporarily unable to service your request due to
maintenance downtime or capacity problems. Please try again later.
Apache/2.2.15 (CentOS) Server at foobar.phoenix.uberspace.de Port 443
ここにCapfile
私が準備したものがあります:
# Capfile
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks
の設定は次のdeploy.rb
とおりです。
# config/deploy.rb
# include uberspacify base recipes
require "uberspacify/base"
# comment this if you don"t use MySQL
require "uberspacify/mysql"
# the Uberspace server you are on
server "phoenix.uberspace.de", :web, :app, :db, :primary => true
# your Uberspace username
set :user, "john"
# a name for your app, [a-z0-9] should be safe, will be used for your gemset,
# databases, directories, etc.
set :application, "foobar"
# the repo where your code is hosted
set :scm, :git
set :repository, "git@bitbucket.org:obama/#{application}.git"
set :branch, "master"
# optional stuff from here
# By default, your app will be available in the root of your Uberspace. If you
# have your own domain set up, you can configure it here
# set :domain, "www.dummyapp.com"
# By default, uberspacify will generate a random port number for Passenger to
# listen on. This is fine, since only Apache will use it. Your app will always
# be available on port 80 and 443 from the outside. However, if you"d like to
# set this yourself, go ahead.
# set :passenger_port, 55555
# By default, Ruby Enterprise Edition 1.8.7 is used for Uberspace. If you
# prefer Ruby 1.9 or any other version, please refer to the RVM documentation
# at https://rvm.io/integration/capistrano/ and set this variable.
set :rvm_ruby_string, "1.9.3@#{application}"
次のコマンドを実行しました。
$ bundle exec cap deploy:setup
$ bundle exec cap deploy:migrations
uberspacifyがすべての構成を処理するのだろうか。RubyOnRailsのuberspace チュートリアルは、fcgiと書き換え.htaccess
ルールで動作します。また、rvmも使用しません。
Gemfile
アプリケーションの内容は次のとおりです。
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '~> 3.2.13'
gem 'counter_culture', git: 'https://github.com/dorilla/counter_culture'
gem 'jquery-rails', '~> 3.0.2'
gem 'therubyracer', '~> 0.11.4', require: 'v8'
gem 'attribute_normalizer', '~> 1.1.0'
gem 'pry', '~> 0.9.12.2'
# Parsing ShapeFiles
gem 'rgeo', '~> 0.3.20'
gem 'rgeo-shapefile', '~> 0.2.3'
gem 'georuby', '~> 2.0.0'
gem 'dbf', '~> 2.0.6'
gem 'gdal', '~> 0.0.5'
gem 'capistrano', '~> 2.15.5'
gem 'uberspacify', '~> 0.9.3'
gem 'mysql2', '~> 0.3.13'
group :assets do
gem 'sass-rails', '~> 3.2.5'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '~> 2.1.1'
end
group :development do
gem 'debugger', '~> 1.6.0'
end
group :development, :test do
gem 'sqlite3', '~> 1.3.7'
gem 'rspec-rails', '~> 2.14.0'
gem 'rspec-smart-formatter', '~> 0.0.4', require: false
gem 'factory_girl_rails', '4.2.1'
gem 'factory_girl_extensions', '2.1.0'
end
group :production do
gem 'mysql2', '~> 0.3.13'
end
興味深いのは、を正常にインストールする前に、トーストパッケージ マネージャー経由でgdalライブラリをインストールする必要があったことです。この gem は、ShapeFile を解析するために必要です。$ toast arm gdal
$ gem install gdal
正常に処理された後に~/.passenger
ディレクトリがないことに気付きました。deploy:setup
deploy:migrations