Do your own Agile…

There’s a lot of buzz going on about software development methodologies, people talking about Agile, Kanban, Pair, XP and more and more. There’s not much people are talking about when it comes to a single developer. I have been a consultant/developer for the past ~3 years or so, working from home for several clients both in Israel and abroad (US mainly). During this time I gained tons of experience in knowing what works and what doesn’t, this may be specific to me, but I don’t think so, so I decided to share this knowledge....

March 8, 2012 · 5 min · admin

Better simple_format for Rails 3.X projects

Since Rails 3.0 came out, we Rails devs deal with the auto escaping of HTML. Now, in most cases it comes in SUPER handy, but not always. Rails has an answer to that, it’s called ‘simple_format’, and it escapes the HTML and formats the string to be friendly, with line breaks, etc… Now, the problem with simple_format is that it wraps everything with a paragraph tag, which doens’t always fit your design, your markup or just your sense of aesthetics....

March 6, 2012 · 1 min · admin

Setup your laptop for Ruby and Rails development

Setting up a new machine has never been an easy task, I remember back in the days where I was a windows user, setting up a new machine was a real pain in the ass. I used to write everything I had installed on a piece of paper and then go one by one and install everything, if I needed to download it could take even days to get a new machine up to speed....

November 15, 2011 · 3 min · admin

Kill all resque workers with a single command

At Gogobot we are running background processes with Resque. We are using God to start workers on all servers, both front end and back end (with different queues). God sometimes has an issue with leaving some stale workers laying around which cache old code, so if you change your code, this is your enemy since you start seeing failed jobs that should not fail what so ever. Even when you stop the rakes (Workers run by rake) with god, it will still leave those lying around....

September 16, 2011 · 1 min · admin

Re-Queue failed jobs with Resque

I have been working with resque for about 1-2 months now, while migrating an application from rails 2 to rails 3, I have switched from Delayed Jobs almost completely. Sometimes, your workers / jobs fail and you need to re-queue them. The trick is to requeue the job and remove it from the failed stats, this way, if it will fail again, the next time you re-queue the job will not be executed twice....

September 8, 2011 · 1 min · admin

Rails uninitialized constant Resque::Server

One of the most significant changes in my migration of a rails app from Rails 2.3.10 to rails 3.0.9 was the move from delayed_jobsto resque. Resque is a Queue system that’s based on Redis, which is much faster and reduces the load on your database. Also we were experiencing some nasty deadlocks with delayed jobs that really broke our transactions and our backs. I installed the gem and installed Redis on my development machine, mounted the Sinatraapp on my rails app and navigated to the web view of resque....

August 31, 2011 · 1 min · admin

Use specific version of RubyGems per project with RVM

If you’re following this blog (and of course you should), you know by now that I have been upgrading a bug project to rails 3. One of the things that I needed to do was to upgrade RubyGems. Since I did not make the switch completely (production still on rails 2.3.10), I’m fixing p0 bugs on the old project and merging the changes. One problem I encountered is that rails 2....

August 24, 2011 · 1 min · admin

Mount a Sinatra app on your Ruby on rails (3) application

I have been migrating a Rails 2.3.10 application to Rails 3.0.9, while doing so I also migrated our queue system from delayed_jobsthat ripped our system apart to Resque. Resque comes with a Sintra app to monitor the Queue, see what’s going on and what jobs failed etc. It’s very convenient and you can really grasp what’s going on with your system. I really missed that in delayed_job (amongst other things)....

August 22, 2011 · 1 min · admin

Uninitialized constant Syck::Syck (NameError)

It’s old news for you devoted reader, but as you know I love coding with Ruby on Railsand that’s what my story for today is all about. I just spent about an hour scratching my head and throwing my keyboard (don’t tell Jobs) around my home office on this issue. I am upgrading an existing project (guess which…) from rails2 and ruby1.8.7 to rails3 and ruby 1.9.2. First thing is of course installing bundler and working with the Gemfile (thank god)....

August 15, 2011 · 2 min · admin

Capistrano – Deploy to servers from different load balancers

As I posted back on March 14th, I work at Gogobot, an app that connects you with your friends all over the world and helps you plan your next new travel. At Gogobotwe are working with Capistranoto deploy our production and to our staging servers. Recently, we changed out architecture and we now have user facing production servers (where you see the pages coming from) and backend servers that run delayed_jobs, resque, photos uploading and many more things that have no business in affecting the load of the user experience....

August 8, 2011 · 2 min · admin