Last active
September 5, 2015 18:18
-
-
Save jhorikawa/d52a2ae2d4e4be60a0b5 to your computer and use it in GitHub Desktop.
Ruby on RailsをCloud9からHerokuへデプロイするセットアップ覚書 ref: http://qiita.com/jhorikawa/items/84a0f4a7f40f5914ad1a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :exception | |
def hello | |
render text: "Hello World" | |
end | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace $ gem install rails -v 4.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace $ rails _4.2.2_ new sample_app | |
~/workspace $ cd sample_app | |
~/workspace $ bundle install --without production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace/sample_app (master) $ bundle install | |
~/workspace/sample_app (master) $ git add -A | |
~/workspace/sample_app (master) $ git commit -m "Updated Gemfile" | |
~/workspace/sample_app (master) $ git push heroku master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace/sample_app $ rails server -b $IP -p $PORT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace/sample_app $ git config --global user.name "My Name" | |
~/workspace/sample_app $ git config --global user.email sample@sample.com | |
~/workspace/sample_app $ git config --global push.default matching | |
~/workspace/sample_app $ git config --global alias.co checkout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace/sample_app $ git init | |
~/workspace/sample_app (master) $ git add -A | |
~/workspace/sample_app (master) $ git commit -m "Initialize" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote add origin git@bitbucket.org:XXX/sample_app.git | |
git push -u origin --all # pushes up the repo and its refs for the first time | |
git push -u origin --tags # pushes up any tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace/sample_app (master) $ heroku login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace/sample_app (master) $ heroku create | |
~/workspace/sample_app (master) $ git push heroku master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can have the root of your site routed with "root" | |
root 'application#hello' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment