I recently read up quite some articles on microframworks and I liked the idea to try out Cuba instead of the regular Sinatra for a change. Here is what I ended up with.
First of all my Gemfile:
source "https://rubygems.org"
ruby "2.0.0"
Since I did not want to constantly re-invent the wheel I will write down my choices for putting together my Cuba template.
rbenv local 2.2.3
or somesuchGemfile.lock
to git
tooroutes
and config
directories, want to put stuff in thereCuba
route in routes/default.rb
#Goal Deploy your Rails App super easily with Dokku on Digital Ocean cheap cheap!
##Notes
Procfile
with the command to start up your application serverLogentries
(not in this guide)AppSignal
or New Relic
(not in this guide)# Ways to execute a shell script in Ruby | |
# Example Script - Joseph Pecoraro | |
cmd = "echo 'hi'" # Sample string that can be used | |
# 1. Kernel#` - commonly called backticks - `cmd` | |
# This is like many other languages, including bash, PHP, and Perl | |
# Returns the result of the shell command | |
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 |
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install http://www.culater.net/software/SIMBL/SIMBL.php | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
# Hauleth's Rails app template | |
# Sass helpers and nicer views | |
gem 'autoprefixer-rails' | |
# Faster HTML escaping | |
gem 'escape_utils' | |
# Translations | |
gem 'r18n-rails' |
### Install OpenJDK | |
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Download and Install ElasticSearch | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb | |
sudo dpkg -i elasticsearch-1.3.1.deb |
ApplicationController.allow_forgery_protection = false | |
app.post('/whatever_my_user_model_is/sign_in', {"whatever_my_user_model_is"=>{"email"=>"users@email.com", "password"=>"users_password"}}) |
I haven't set up an install guide for the latest ubuntu release, largely because the last set of instructions worked pretty closely with the latest and greatest Ubuntu, 12.04 Precise Pangolin, however when installing today, I found that there were enough differences in the way that I configure my setup to justify an update, so here it goes. Yes, I'm late to the party, but a quick google search didn't find anything that I felt was as complete for my requirements as my previous install guides, so here I go.
As always with my install guides, I have included here is just about everything you'll need (and then some) to get started with ruby on rails development with Ubuntu 12.04 as a platform. These are my settings and preferences, and this is certainly not the only way of doing things, so keep that in mind.
sudo apt-get update && sudo apt-get upgrade