Use the back button in Cucumber
In order to go back one page in your Cucumber tests, you can use the following step definition for Capybara...
Test a gem in multiple versions of Rails
Plugins (and gems) are typically tested using a complete sample rails application that lives in the spec folder of the...
Install a specific version of a gem
To install webmock 1.5.0: sudo gem install webmock --version "=1.5.0" or sudo gem install webmock -v "=1.5.0"
Prevent Bundler from downloading the internet
As a user of Bundler you have spent significant time looking at this message: Fetching source index for http://rubygems.org...
Defining and using sub-classes with modularity
Given this class: class Foo class Bar end end If you want to clean up this code with the modularity...
Install gems for all bundled projects
This is a bash script for those of you who need to install all gems for all projects (e.g. to...
Fix LoadError with Rails 3 applications on Passenger
After switching to Rails 3 you may get a LoadError with the following message when trying to use your application...
Migrating to RSpec 2 from RSpec 1
You will need to upgrade to RSpec >= 2 and rspec-rails >= 2 for Rails 3. Here are some hints to...
Shell script to quickly switch Apache sites
I prefer the application that I'm currently working on to be reachable at http://localhost/. So when I switch...
On memoizing methods that return a scope
Be careful when memoizing a method that returns a scope, e.g.: def variants scoped(:conditions => { :name => name }) end memoize :variants...
Working around the ancestry gem's way of object destruction
The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall...
Install the Nokogiri gem on Ubuntu servers
You need to install the following packages before you can build the Nokogiri gem: sudo apt-get install libxml2-dev...
Even with bundler your gem order can be significant
Even when you're using bundler, it might be significant in which order your gems are listed in your Gemfile...
jsmestad's pivotal-tracker at master - GitHub
Ruby gem that provides an AR-style interface for the Pivotal Tracker API.
Install the Paperclip gem on Ubuntu servers
You need to install the following packages before you can build the Paperclip gem: sudo apt-get install imagemagick librmagick...
Save ActiveRecord models without callbacks or validations (in Rails 2 and Rails 3)
You can use record.send(:update_without_callbacks) or record.send(:create_without_callbacks) This can be used as a...
Use Sass without Rails
You don't need a Rails application to use Sass. Even when you're working on a static site you...
Run a rake task in all environments
power-rake db:migrate VERSION=20100913132321 By default the environments development, test, cucumber and performance are considered...
Install RubyGems on Ubuntu/Debian
First of all: You could just use RVM which would make the pain go away. If for some reason you...
Detect the language of a string
You can use the whatlanguage gem to detect the language of a Ruby string. Note that it also has not...
rhulse's rails-css-views at master - GitHub
This gem is designed to provide CSS views to Rails, and a process to concatenate and minify these files to...
lib/bundler/capistrano.rb at master from carlhuda's bundler - GitHub
Capistrano task for Bundler.
Install a local Gemfile on a remote server
Call with the server's hostname (and user if you have no SSH agent), e.g. install-gems-remotely my.server.com
Debug Ruby code
This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...