daitokaiet で遊びたいので fork and clone からの bundle install をきめた。
local で、Postgres93.app を立ち上げておいて
bundle exec rake db:create:all
bundle exec rake db:migrate RAILS_ENV=development
をきめた。
これで bundle exec rails s
が動きました。
Twitter アプリを1つとって、
https://dev.twitter.com/apps/??????/settings
で、2つの
TWITTER_KEY=**********
TWITTER_SECRET=**********
を持ってきて .env に書いておきました。
pow を使うなら .powenv に
export TWITTER_KEY=**********
export TWITTER_SECRET=**************
と書けばよいです。
view で
= ENV['TWITTER_KEY'] + ' ' + ENV['TWITTER_SECRET']
などとしたら表示されたので環境変数として読めているようです。(printfデバッグかよっ)
-
Callback URL: は http://0.0.0.0:3000/users/auth/twitter に (Pow なら http://daitokaiet.dev/users/auth/twitter など)
-
Type は Read, Write and Access direct messages に。
-
Allow this application to be used to Sign in with Twitter もチェック
-
試行錯誤で認証がおかしくなった場合は https://twitter.com/settings/applications で一旦「許可を取り消す」といいかも
pow を入れて、(注意: tmux の外でやること) gem i powder をした。
~/.powconfig に export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
(ここに書いてある https://github.com/37signals/pow/wiki/Troubleshooting)
.powenv にかく。ただし export する。 export TWITTER_KEY=hogehoge