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"
# put this in your test_helper.rb if you encounter the following error: | |
# NoMethodError: undefined method `failure_message' for Capybara::Helpers:Module | |
# (eval):19:in `block in assert_link' | |
# when using minitest-capybara with capybara 2.0.3 e.g. if you are stuck on Ruby 1.9.2 | |
# and you will have decent error messages again | |
# (stolen from Capybara 2.1.0 on which minitest-capybara implicitely depends) | |
module Capybara |
I used this to manually set up my vagrant box once OS X stopped compiling 1.9.2 and I am still stuck with it on my hoster.
vagrant init trusty64 trusty64.box
# now edit your Vagrantfile to include something like
config.vm.network "forwarded_port", guest: 3000, host: 3696
# to put your rails app wherever you like it
vagrant up
vagrant ssh
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
Well, my Yosemite Mac refused to run Ruby 1.9.2, but I still had these apps running with this stubborn hoster, so I needed a way to not just develop, but also deploy these things. Capistrano would easily cut it, but it usually runs out of the same directory. Deploying from vagrant would be an option, but I wanted something more "durable" which would work for several setups with the same credentials. Ubuntu headless server would do nicely for this, so i used these instructions to get it up and running:
https://leemendelowitz.github.io/blog/ubuntu-server-virtualbox.html
This mostly worked all right, with just a minor oversight of his part which became apparent since I wanted just one deployment disk which I could use for several deployments. The variable he defines is not used, so I ended up doing the following:
VM_NAME="Deploy-1.9.2-server"
UBUNTU_ISO_PATH=~/Downloads/ubuntu-14.04.1-server-amd64.iso
VM_HD_PATH="DeployDisk.vdi" # The path to VM hard disk (ended up in an inconvenient place like th
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
I ran into this job description: | |
Tasks | |
As a member of a delivery team: | |
• Collaborate with Product Owner to create and refine User Stories and Acceptance Criteria, as well as confirm that the code and acceptance tests reflect the desired functionality | |
• Participate in Product Increment and Iteration Plannings by: | |
• Analyzing the product and team backlog items | |
• Estimating the work effort | |
• Committing to the iterations and Product Increment objectives |