Blog Archives

Getting started with Heroku and Rails 3.1

Pre-requesites: RVM on your local machine with Ruby 1.9.2 Heroku account Switch to the 1.9.2 version of Ruby, install the rails and heroku gems, create your rails 3.1 application Terminal $ rvm 1.9.2 $ gem install rails $ gem install heroku $ rails new tickets $ cd tickets Add in the nifty-generators gem: /Gemfile gem "nifty-generators", [...]

Making your Rails app work on Java

So you’ve written a Rails app and you want to show it off to your boss at work because you know that it will impress them. Problem is that your company only uses Java and won’t consider it for their production environment if it can’t be deployed under a JVM. Let’s go: Install JRuby http://jruby.org [...]

Getting Ruby to talk to Oracle with Cygwin

I need to be able to use Ruby to talk to Oracle databases to help us easily build scripts for maintenance and support. So, I started doing some googling and found ruby-oci8. Excellent! I’m also mainly PC bound so I needed to get this working on my cygwin installation. My entire Ruby environment is running [...]

SSL setup for Ruby

I found recently that I wanted to get SSL enabled when making HTTP connections with Ruby. However, if you’re wishing to talk to servers that have certificates signed by commercial certificate authorities then you won’t be able to verify them when you make a connection: require ‘net/http’ require ‘net/https’ http = Net::HTTP.new(‘www.google.com’, 443) http.use_ssl = [...]

Dependency injection for Rails

I’d been looking around for how to do Dependency Injection (Inversion of Control) in my Rails App. I don’t need anything particularly fancy, just the ability for classes (controllers in particular) to have different service implementations injected into them depending on the environment that they’re in. Something which I take for granted in the Java [...]