This is a summary of some of the tools I’m using with Rails, I’m putting together a list to try and get a few more people trying it out. I’m hoping a few people will try out some of the tools and ask questions in the Ruby forum.
Ruby / Rails Tools
Rails is quite simply the best way to build web applications, I’m not lying to you.
It is a collection of best practices, agile workflow and tooling to make web development fun and productive again. I Really Like Rails.
Nearly all Rails developers use Mac OSX, it’s easiest to follow along and receive help if you’re using the same.
If you only have access to windows it’s probably worth downloading and running Ubuntu cause you really need a unix shell.
But if you’re intent on using windows check out http://railsinstaller.org/
Now that we all have our shiny dev machines encased in aluminum…
Read the official rails guides, they contain everything you need to know.
I can’t stress how ridiculously good these docs are, they will answer all of your questions.
Installation and Tools
On a clean install of OSX
Software Update… from the apple menu
install XCode from the app store
Install Command Line Tools for Xcode from http://developer.apple.com/downloads
Learn to love the command line
gem update --system
gem install bundler
gem install rails
gem install heroku
If it says “command not found: gem” download and install here
If you don’t have a github account yet create one
If you don’t have a heroku account yet create one
git config --global user.name "<your name>"
git config --global user.email <your email>
git config --global color.ui true
If it says “command not found: git” download and install here
Generate SSH keys to authenticate your machine with your github account
Run “brew install <package>” and read all of the output, if something hasn’t installed correctly it will tell you how to fix it.
You can run “brew doctor” to see if something’s not quite right.
brew install rbenv
brew install postgresql
brew install git-flow
brew install imagemagick
brew install gs
Not free, but a fast, lean, beautiful text editor
A Rack server for development
Create a Rails app, put source in Github, deploy to Heroku
You can put your applications anywhere but “projects” in the home directory “~” is a common place, all other code repos you can clone to ~/code
Create a new rails application called ‘barebones’ using postgresql
rails new barebones -d postgresql
Install all the gems in Gemfile
Edit database config
Paste this and save
Create the database
Symlink to the pow directory so you can run it locally
ln -s ~/projects/barebones
Init git and commit all files
git add .
git commit -am 'first commit'
Add a ‘remote’ so you can push code to github
git remote add origin email@example.com:<your-name>/barebones.git
git push origin master
Create a heroku app and deploy to it
git add remote heroku <heroku-git-address e.g. firstname.lastname@example.org:warm-ocean-5452.git>
git push heroku master
We now how have:
A new rails app with db running at [indent][noparse]http://barebones.dev/[/noparse] on the Pow server for development[/indent]
Our code in a github repo at [indent][noparse]https://github.com/<your-name>/barebones[/noparse][/indent]
A Live environment hosted on Heroku at an address like [indent][noparse]http://warm-ocean-5452.herokuapp.com/[/noparse][/indent]
Check out http://guides.rubyonrails.org/ to learn more.
SASS & Coffeescript are defaults in Rails so you’ll already have these in your Gemfile
Add HAML and Compass and ‘bundle install’ or ‘bi’ if you installed ohmyzsh
Haml compiles to HTML
Sass & Compass compile to CSS
I still occasionally butt heads with Coffeescript and Haml but for the most part I find them great and they require a lot less code.
Sass and Compass are absolute no brainers, if you’re not using them yet, do.
edit.haml, application.js.coffee, application.css.scss
Testing with Cucumber, Capybara and RSpec
There’s great value in writing automated tests, refactor your code and ensure you haven’t broken anything.
group :test do
Intelligent branching patterns for git
A powerful search database similar to Lucene, Ferret or Solr
Automate things e.g. provisioning servers, deployment tasks, building a dev environment
Paperclip with imagemagick
Attach files / images to ActiveRecord models
Search for gems and find which ones are active and popular
Performance Monitoring for you app
If you have any questions about any of those tools or ran into problems setting up your environment ask away.