Using Foreman with Upstart & Capistrano

Using Foreman with Upstart & Capistrano

Foreman is a great tool for running multiple processes along side your rails project. Processes like Redis, Sidekiq, Faye or any other process that doesn’t run within Rails itself. Foreman runs in your development environment as well as your production environments. To use Foreman in production, you have to export it’s config file in one of the following formats: bluepill inittab launchd runit supervisord systemd upstart Since most of the servers we work on...

User does not respond to 'devise' method

I’ve recently went back to an old project and it seems to have stopped working giving me this error: ~/projectx/vendor/ruby/1.9.1/gems/devise-2.0.0/lib/devise/rails/routes.rb:391:in `raise_no_devise_method_error!': User does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's being loaded too late. To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb' or before your application...

RVM install ruby-1.8.7-p330 fails

Today I’m thinking of getting back into so good old work and I read there is a new patch to Ruby, version p330. So I figure that RVM (Ruby Version Manager) being so easy and quick to update, I’d do the good old “rvm get head, rvm reload, rvm update 1.8.7” and I’m off to the races. Well it wasn’t quite as simple. I ended up with an error: ruby-1.8.7-p330 - #fetching ruby-1.8.7-p330 - #extracting ruby-1.8.7-p330 to...
Stripping ASCII colour from a ruby string

Stripping ASCII colour from a ruby string

I spent a few good hours trying to figure out how to strip a coloured ruby string: which comes out as this: >> p t"2 scenarios (e[33m2 undefinede[0m), 7 steps (e[36m2 skippede[0m, e[33m3 undefinede[0m, e[32m2 passede[0m)"=> nil Now I tried to gsub the string and remove the colour using a RegEx like this: > t.gsub(/\e[(d+)m/, "") => "2 scenarios (e[33m2 undefinede[0m), 7 steps (e[36m2 skippede[0m, e[33m3 undefinede[0m, e[32m2 passede[0m)" But as you can...

Getting Paperclip to work with MongoMapper

Last night I was trying really hard to get MongoMapper to work with Paperclip via GridFS and failed. It seems right now Paperclip or even CarrierWave are not ready to be used with the latest MongoMapper drivers and GridFS (and I needed to use the latest drivers due to Scopify). After giving up using GridFS, I wanted to use Paperclip with MongoMapper with the normal file system and I found this article from Ben Curtis, however with the latest version of Paperclip...

Error with fsevent and autospec (on Mac)

Today I’ve upgraded my gems and noticed that when running my autospec I get an odd error: [01:09:25 /usr/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.10/lib/ole/storage/base.rb:146:load] WARN   root name was “R” And my autospec would keep printing out: sh: line 1:  6303 Trace/BPT trap          /usr/local/lib/ruby/gems/1.8/gems/autotest-fsevent-0.1.2/fsevent/darwin/fsevent_sleep ‘/Users/andrew/rails_apps/example_com’ 2>&1 sh: line 1:...