LoginSignup
6
5

More than 5 years have passed since last update.

とりあえず、rubyでheroku

Last updated at Posted at 2014-06-30

私の環境

  • macbook air
  • vagrant(centos 6.9)
  • 2018/4/30

herokuに登録

公式ページ
Heroku

大体普通に進めた通り

事前準備

・gitがいるらしい(省略)
・herokuのコマンドを使える必要があるらしい
 (heroku toolbelt)

ドキュメントを参考に、centosだったので以下で入れました。

curl https://cli-assets.heroku.com/install-standalone.sh | sh

すると数秒にてインストールできました

# heroku --version
heroku/7.0.17 linux-x64 node-v10.0.0

OSによっていろいろあるようです
スクリーンショット 2018-04-30 1.52.02.png

デプロイなど

web.rb
require 'sinatra'

get '/' do
  "Hello, world"
end      

ソースは何でもいいと思います。buildpackというのはよくわかりません

結果

これだけでhello world。

スクリーンショット 2014-06-30 23.14.18.png

復習

1.ユーザ登録
 サービスを使うために、ユーザ登録が必要。

2.heroku create
 herokuのコマンドが提供されています。createでプロジェクトというかアプリを作成します(create [APP_NAME])。何も付けなかったので、「serene-sierra-8594」など付けられました。

3.git cloneなりコード作成
 つまり、あるものを取ってくる。ここでは、サンプルを取得しているのでしょう。

4.git push heroku master
 サンプルを取ってきて、heroku側でcreateしたものにdeployしました。

5.heroku open

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5