Upgrade to Pro — share decks privately, control downloads, hide ads and more …

heroku-intro.pdf

 heroku-intro.pdf

Avatar for k-ta-yamada

k-ta-yamada

February 26, 2018

Other Decks in Programming

Transcript

  1. index what is Heroku? heroku apps:create heroku git:clone create app

    bundle install & create app.rb make Proc le git commit & push => Deploy heroku apps:open 2
  2. create app (1/3) cd {app-name} # add sinatra gem bundle

    init bundle install --path vendor/bundle bundle add sinatra # app.rb cat << EOF > app.rb require 'sinatra' get '/' do 'hello' end EOF 6
  3. create app (2/3) # Procfile for heroku echo web: bundle

    exec ruby app.rb -p $PORT > Procfile # start local bundle exec ruby app.rb # or `heroku local` start http://localhost:4567 http://localhost:4567 7
  4. create app (3/3) # .gitignore echo .bundle/ >> .gitignore echo

    vendor/ >> .gitignore # or `gibo ruby >> .gitignore` # git push git add . git ci -m first git push # open app heroku apps:open https://{app-name}.herokuapp.com/ 8