Heroku is a simple way to publish your Rails app, and a powerful platform that will allow it to scale. In this episode, Jay McGavren gets you started with your first Heroku app.
- You WANT Rails to fail locally if a gem isn't in your Gemfile
| #encoding: utf-8 | |
| module LocalizedDateLiquidFilter | |
| MESES = [nil] + %w(Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro) | |
| def localized_date(date) | |
| if date.class == String | |
| date = Time.parse(date) | |
| end |
| $sudo git init --bare my_project.git | |
| Initialized empty Git repository in /opt/git/my_project.git/ | |
| $sudo chown -R git:git my_project.git/ | |
| git clone [email protected]:/opt/git/my_project.git |
Heroku is a simple way to publish your Rails app, and a powerful platform that will allow it to scale. In this episode, Jay McGavren gets you started with your first Heroku app.
| #!/usr/bin/env bash | |
| apt-get -y update | |
| apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
| cd /tmp | |
| wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
| tar -xvzf ruby-1.9.3-p125.tar.gz | |
| cd ruby-1.9.3-p125/ | |
| ./configure --prefix=/usr/local | |
| make | |
| make install |
| require 'irb/ext/save-history' | |
| #History configuration | |
| IRB.conf[:SAVE_HISTORY] = 1000 | |
| IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" |
| execute pathogen#infect() | |
| syntax on | |
| filetype plugin indent on | |
| set expandtab | |
| set tabstop=2 shiftwidth=2 softtabstop=2 | |
| set autoindent | |
| sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
| sudo touch /etc/apt/sources.list.d/10gen.list | |
| sudo echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list.d/10gen.list | |
| sudo apt-get update | |
| sudo apt-get install mongodb-10gen |
| ### Esse gist ainda não está 100% | |
| aparentemente tem que fazer um gem install passenger **também** | |
| sudo apt-get install python-software-properties ### PARA INSTALAR add-apt-repository, se não tiver no sistema | |
| sudo apt-get install software-properties-common ### NO UBUNTU 13.04 | |
| sudo add-apt-repository ppa:nginx/stable ### PARA INSTALAR SOMENTE NGINX, SEM PASSENGER - USE SOMENTE COM PHP | |
| sudo add-apt-repository --remove ppa:nginx/stable ### PARA REMOVER NGINX, SEM PASSANGER - USE SOMENTE SE TIVER INSTALADO | |
| sudo add-apt-repository ppa:brightbox/passenger-nginx ### PARA INSTALAR VERSAO RECENTE DO NGINX COM PASSENGER |
| ##Configura repositório apt-do MongoDB | |
| sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
| sudo touch /etc/apt/sources.list.d/10gen.list | |
| # Esse comando com echo e sudo tee funciona | |
| echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list | |
| ## Esse comando cat com sudo não funciona. Precisa editar manualmente | |
| sudo cat <<EOF > /etc/apt/sources.list.d/10gen.list |
| #!/bin/bash | |
| set -e # exit on error | |
| ### README | |
| # * built for Ubuntu (Lucid Lynx) | |
| # * uses GIT via SSH because of !@#$% proxy at work | |
| # * installs your desired ruby version (1.9.2-p290 per default) using rbenv | |
| # ** including openssl (needed by bundler) | |
| # ** including sqlite (probably needed for rails apps) | |
| # | |
| # Before you start: |