To update your Rubygems to the latest available version, type the following: gem update --system Note that you have a...
On Ruby 1.9+, standard ruby character classes like \w, \d will only match 7-Bit ASCII characters: "foo" =~ /\w+/ # matches...
To check which rubygems versions your different rbenv rubys are using, you can use this small bash script:
CTRL + SHIFT + ALT + N : Search for any symbol in your application, like CSS classes, Ruby classes, methods, helpers etc...
Very detailed guide to caching Ruby on Rails. Goes well with the official Rails guide on caching.
If a SOAP API expects you to call a remote method with arguments of complex types, Savon lets you manually...
Good article about ruby singleton classes.
Developing complex regular expressions quickly blows my mind. Here are some online regex editors that help you by highlighting matching...
Capistrano 3 is a major rework of the framework and requires several adjustments to your deploy configuration files. The biggest...
Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g...
There are times when you have a chunk of text that you want to do something with, e.g. replace something...
TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby...
It is a common misunderstanding that all [op]=-operators work the same way, but actually they don't. ||= and &&=
When using send_file (for example for attachments of any kind), make sure your application knows the correct mime types...
You can freeze any Ruby object to prevent further modification. If you freeze an ActiveRecord and try to set an...
If you want to grow a Ruby Array, you might find out about #fill but it is not really what...
Code folding is a very useful feature to me. It gives me a quick overview over a file and keeps...
When using threads, you must make your code thread-safe. This can be done by either locking (mutexes) all data...
Today I learned that Ruby on Rails has shipped with a built-in slug generator since Rails 2.2:
Nested exceptions for Ruby: When you rescue an error and then re-raise your own, you don't have to...
Web applications can be used by multiple users at the same time. A typical application server like Passenger has multiple...
If you need to log to a file you can use Ruby's Logger class: require 'logger'
This is useful to kill processes like ruby my-script.rb: pkill -f my-script.rb With great power comes great responsibility.
If you're on Ruby 2.3+ there's a <<~ operator to automatically unindent HEREDOCs: str = <<~MESSAGE Hello Universe!