ruby

Running rvm ruby 1.9.2 with rvm packages on OSX Lion - failing to make due to readline

Getting rvm rubies to compile with the rvm packages isn't turning out that easy.

First off - you need to get XCode for Lion installed from the App Store (even if you upgraded from Snow Leopard - Lion needs a newer version). In addition - the App Store downloads an XCode installer - you also have to run it to get it installed ;)

So I grabbed the latest rvm:

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

This puts up the following message:

PDFKit on heroku on rails 3 - downloadable PDFs and avoiding Backlog too deep

Backlog too deep errors running PDFKit on heroku

Running PDFKit on heroku kept giving Backlog too deep errors in the logs.

This error occurs when there are not enough dynos (think threads) available. The default (free) is one dyno.

The reason for this is that the request calls out to wkhtmltopdf which in turn requests the embedded resources (script files, images, css files etc). These go into the queue waiting for the original call to terminate which it doesn't.

bash helper function for rvm gemsets

By convention I use an rvm gemset per project - named after the directory that the project lives in.

For example src/rails/foo would have gemset foo

Since I switch a lot between machines - I always end up having to go check if the gemset exists and create it if not.

A small bash function (dump it in .bash_profile) and then when in the projects home dir you can just run rvmgo (or if you want a different ruby then e.g. rvmgo 1.8.7) and it will switch to the correct version/gemset creating the gemset if needed.

Note - it will not install a missing ruby.

Technical:

Drupal cron script

To avoid having to set up multiple cron lines - here's a script that will read your drupal install(s) and call cron on each one found.

Not sure where I saw the code (rss feed) - but the comment was present in the downloaded code - so thats a pointer to where it starts.

Changes I've made - the dir match is changed from ** to * so that it will follow symlinks. It also handles multiple drupal installs. Timeout wrapping added - one of my sites takes a long while to return.

Technical:

Subscribe to RSS - ruby