Archives par mot-clef : ruby

Retry after errors, with exponential backup (in Ruby)

There are situations where some errors can occur. Let’s say you connect to a remote service, like a database or an API over HTTP. An error raised by your client is not always permanent. It might be a network glitch … Lire la suite

Publié dans Informatique, Personnel | Tagué | Laisser un commentaire

Monit, Unicorn and UTF-8

I’ve spent an entire afternoon trying to debug an issue we’ve been having with one of our Rails apps. It is deployed on a Linux server, where Monit is in charge of supervising the Unicorn processes. A quick reminder : … Lire la suite

Publié dans Informatique | Tagué , , , | Laisser un commentaire

How to rebuild native Ruby gems after a lib/system upgrade?

How to rebuild a Ruby gem with a native extension, after a library or system upgrade? Lire la suite

Publié dans Informatique | Tagué , | Laisser un commentaire

HotelHotel cherche un développeur web expérimenté

Ça fait 4 ans que je travaille sur le site HotelHotel (et ce qui gravite autour), avec toujours autant de plaisir et de passion. Depuis peu, on a passé notre seuil de rentabilité. J’ai même fait un retour d’expérience technique à … Lire la suite

Publié dans Autrement, Informatique | Tagué , , | 2 commentaires

API Versioning in Rails with Accept HTTP headers

To implement API versioning in Rails, not using URL namespaces but custom MIME types, there are a few different approches. The Tribesports way Recently, I’ve seen a blog post about the Tribesports API. They chose to add a new MIME … Lire la suite

Publié dans Informatique | Tagué , , , , | 4 commentaires

You have modified your Gemfile in development

Twice this week I’ve had a problem with Bundler (1.0.10). During a deploy with Capistrano, I had some errors like this : I’ve searched in Google for this kind of errors, and everything I’ve found was dealing with .bundle directories, … Lire la suite

Publié dans Informatique | Tagué , , , | Laisser un commentaire

Assignment-like methods and the returned value (in Ruby)

An assignment-like method in Ruby always return the Right-Hand Side of the method (the parameter) and never the result of the method. I’ve learnt this the hard way. Lire la suite

Publié dans Informatique | Tagué | 3 commentaires

RVM, Passenger and symlinks

Here is some kind of follow up after my previous lengthy description on how we use RVM, Passenger and Rails at work. One of my co-workers has updated RVM this morning (to get the brand new 1.0.0) and all his … Lire la suite

Publié dans Informatique | Tagué , , , | Laisser un commentaire

Rails 3 lazy-loading and the console

While debugging an Rails 3 application in development, I started to wonder if the lazy-loading feature of ActiveRecord 3 was really working. In a model, I was building a query depending on some parameters. Something like this (obviously simplified) : … Lire la suite

Publié dans Informatique | Tagué , , | Laisser un commentaire

Advice on using Ruby, RVM, Passenger, Rails, Bundler, … in development

A description of those « new tools » — RVM, Bundler and Passenger — and some advice on how to efficiently use them (beyond the roughness of their beta versions) in a development environment for Ruby and Rails. Lire la suite

Publié dans Informatique, Mac, PLUG | Tagué , , , , , | 19 commentaires