goo blog サービス終了のお知らせ 

やーよわきか?

常に強気でいろんなものに挑戦していきたいものですな~。
いろいろと挑戦していく過程のメモ書き等。

Windowsへrubyのインストール

2014-01-25 09:07:00 | 開発環境・ツール
RubyInstaller をつかってインストール

以下から「RubyInstaller」と「Development Kit」ダウンロード
http://rubyinstaller.org/downloads/

「RubyInstaller」をクリックして自動インストール
途中環境PATHを通すか聞かれるので、それだけチェック

「Development Kit」は解凍してrubyのインストールフォルダへ上書きコピー

コマンドプロンプト起動
とりあえず ruby -v でインストールの確認

次に以下を入力
ruby dk.rb init
ruby dk.rb install

gemをアップデート
gem update

とりあえずここまで

herokuへDBを使ったアプリのディプロイ

2013-06-09 02:14:00 | 開発環境・ツール
herokuへディプロイするにはGemfileを以下のように修正する必要がありました。

gem 'sqlite3'

 ↓に修正

group :development, :test do
gem 'sqlite3'
end

group :production do
gem "pg"
end

これで bundle install をするとpgの部分でエラーになってたので省いていました。
ただ、これだとDBを使ったアプリがディプロイできない!

以下の手順にてPostgreSQLをインストール。

#PostgreSQlのインストール
sudo apt-get -y install postgresql-9.1

#日本語(UTF-8)用のロケールを生成
sudo locale-gen ja_JP.UTF-8
sudo service postgresql restart

#PostgreSQLに関連する開発ファイル
sudo apt-get -y install libpq-dev

※Ubuntu13.04にて

PostgreSQLはあまり使ったことがないので、結構苦戦しました…。
以下の書籍にて解決!

<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=maroshi04-22&o=9&p=8&l=as1&asins=B00CIR1QEM&ref=qf_sp_asin_til&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

herokuでのマイグレーションは以下

heroku run rake db:migrate --app [app-name]


Heroku へのディプロイ

2013-06-03 00:23:00 | 開発環境・ツール
$ bundle install
$ git init
$ git add .
$ git commit -m 'first commit'

ここでエラー
ーーーーーーーーーーーーーー
*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got '****@****.(none)')
ーーーーーーーーーーーーーー

以下を入力で解決

$ git config --global user.email "****@****"

リモートレポジトリ(Heroku)の追加
$ git remote add [APP_NAME] git@heroku.com:[APP_NAME].git

プッシュ(Herokuにデプロイ)
$ git push [APP_NAME] master

確認する。
$ heroku open

Heroku Toolbeltのインストール

2013-06-01 22:11:00 | 開発環境・ツール
UbuntuでHeroku
ubuntuは13.04

以下の手順で完了!

$ apt-add-repository 'deb http://toolbelt.herokuapp.com/ubuntu ./'

$ curl http://toolbelt.herokuapp.com/apt/release.key | sudo apt-key add -

$ apt-get update

$ apt-get install heroku-toolbelt

以下のページ参考にしました!
yellow monkeyの日記:UbuntuにHerokuのツールをinstall
ありがとうございます<(_ _)>

以下でherokuへのログイン確認
$ heroku login

以下でheroku作成したアプリを確認!
$ heroku list

sshの鍵は作成していたので以下でherokuへ登録

$ heroku keys:add ~/.ssh/id_rsa.pub