HEROKU
From Sandoz
Gemfile: source 'http://rubygems.org' gem 'rails', '3.0.3' gem "heroku"
Git:
$ git init
Initialized empty Git repository in .git/
$ git add .
$ git commit -m "new app"
Created initial commit 5df2d09: new app
Heroku ssh:
ssh-keygen -t rsa
Generating public/private rsa key pair.
$ heroku keys:add
Uploading ssh public key /home/joe/.ssh/id_rsa.pub
Deployment: heroku create appname Enter your Heroku credentials. Email: joe@doe.com Password: Uploading ssh public key /home/joe/.ssh/id_rsa.pub Created http://appname.heroku.com/ | git@heroku.com:appname.git Git remote heroku added
git push heroku master Counting objects: 65, done. Compressing objects: 100% (58/58), done. Writing objects: 100% (65/65), 80.54 KiB, done. Total 65 (delta 14), reused 0 (delta 0)
Heroku receiving push
Rails app detected
Compiled slug size is 0.1MB
Launching....... done
App deployed to Heroku
To git@heroku.com:appname.git
3b3ed7c..350b521 master -> master
$ heroku rake db:migrate $ heroku rake db:seed
heroku open
New change: git add . <-- ajouter un fichier git commit -m "changement" <-- commit git push heroku master
heroku rename <app_name> <-- permet de renommer son application heroku logs <-- permet de consulter les logs de son site heroku logs --tail heroku run env $ heroku run console $ heroku run rake db:migrate
heroku ps $ heroku addons:add shared-database gem 'pg', '0.10.0' ->postgres $stdout.sync = true
rvm gemset create myapp $ rvm gemset use myapp heroku run rake -T
Il est aussi possible d'ajouter son propre nom de domaine sur Heroku:
heroku addons:add custom_domains:basic <-- ajoute l'add-ons au site web heroku domains:add <urldusite.com <-- ajoute le nom de domaine au site
Sources:
https://devcenter.heroku.com/articles/ruby
http://pcoding.blogspot.com.au/2011/03/tutorial-heroku-ruby-on-rails.html
https://devcenter.heroku.com/articles/account-confirmation
https://github.com/HugoMano/Rack-Static-Site