Octopress Blog

自分のためのまとめブログ

Heroku

初期設定例

公式そのまま

1
2
3
4
5
git clone git://github.com/heroku/ruby-sample.git
cd ruby-sample
heroku create
git push heroku master
heroku open

ruby-sampleに入っているファイル

Gemfile
1
2
3
source :rubygems
gem 'sinatra', '1.1.0'
gem 'thin'
Gemfile.lock
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
GEM
  remote: http://rubygems.org/
  specs:
    daemons (1.1.9)
    eventmachine (0.12.10)
    rack (1.4.1)
    sinatra (1.1.0)
      rack (~> 1.1)
      tilt (~> 1.1)
    thin (1.4.1)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    tilt (1.3.3)

PLATFORMS
  ruby

DEPENDENCIES
  sinatra (= 1.1.0)
  thin
Procfile
1
web: bundle exec ruby web.rb -p $PORT
web.rb
1
2
3
4
5
require 'sinatra'

get '/' do
  "Hello, world"
end

heroku create したあとにheroku上にできたもの

limitless-hollows-2098のリンク

git push heroku master したあとにheroku上にできたもの

limitless-hollows-2098のリンク先「Dynos」web bundle exec ruby web.rb -p $PORTの項目


HerokuにRedmineをインストール

Redmineをherokuにデプロイする この手順を参考に

手順以外にやったこと

  • パッケージをインストール(CentOS6.4)
1
sudo yum install mysql-devel ImageMagick ImageMagick-devel postgresql

これをやらないとbundle installでエラーになる
その他エラーが出る場合は、メッセージをググって適宜必要なパッケージをyumで入れればいいと思う。

  • 以下のエラーがでたのでknown_hostsをリセット
1
 ! [remote rejected] 2.1-stable -> master (pre-receive hook declined)

~/.ssh 配下のknown_hostsを適当にリネームしました。

ここでインストールは終了

  • パスワード変更 デフォルトはadmin:adminなのでパスワードを変更
    言語を日本語にしてタイムゾーンをTokyoに変更