ラベル Mac の投稿を表示しています。 すべての投稿を表示
ラベル Mac の投稿を表示しています。 すべての投稿を表示

2013年6月2日日曜日

Heroku Postgresのデータをローカルにリストアしてみたヘ(^o^)ノ

環境
Mac OS X 10.8.3
Postgres.app

Heroku

PG Backupsアドオンを追加
$ heroku addons:add pgbackups --app アプリ名

Heroku Postgresのデータをバックアップ
$ heroku pgbackups:capture --app アプリ名

Heroku Postgresへログインしてバックアップファイルをダウンロード



バックアップファイルをPostgres.appへリストア
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost \
         -d データベース名 バックアップファイル名(パス)

Postgres.appはとても便利で簡単にPostgreSQLを利用できますよ

( ̄(エ) ̄)彡☆

2013年3月12日火曜日

MBAの環境構築ヘ(^o^)ノ

ヘ(^o^)ノ

Xcode
Command Line Tools
Homebrew

$ brew install wget
$ brew install rbenv
$ brew install ruby-build

.bashrc or .zshrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - zsh)" ← zsh
eval "$(rbenv init -)" ← bash

$ rbenv install 2.0.0-p0
$ rbenv global 2.0.0-p0
$ gem install bundle
$ gem install pry
$ gem install powder
$ rbenv rehash

bashの人
bundler exec
curl -L https://github.com/gma/bundler-exec/raw/master/bundler-exec.sh > ~/.bundler-exec.sh
$ echo "[ -f ~/.bundler-exec.sh ] && source ~/.bundler-exec.sh" >> ~/.bashrc

zshの人
bundler exec 
$ curl -L https://raw.github.com/willnet/bundler-exec/master/bundler-exec.sh > ~/.bundler-exec.sh
$ echo "[ -f ~/.bundler-exec.sh ] && source ~/.bundler-exec.sh" >> ~/.zshrc

Github for Mac
iTerm2
TextMate バイナリはここ
Postgres.app
MacRuby
RubyMotion (有料ですw
R for Mac
RStudio

TextMateでRubyMotionの補完 ここを参考
$ cd ~/Library/Application\ Support/
$ git clone https://github.com/libin/RubyMotion.tmbundle.git Avian/Bundles/RubyMotion.tmbundle

Railsヘ(^o^)ノ
$ mkdir hoge
$ cd hoge
$ vi Gemfile

Gemfile
source 'https://rubygems.org'
gem 'rails', git: 'git://github.com/rails/rails.git'

$ bundle install --path vendor/bundler
$ rails new .  (bundler execがインストールされてないならbundle exec rails new .
$ bundle

こんな感じ