Rails. Dreamhost.

Interesting things that I’ve noted recently:

  • I ran into a strange bug with rmagick that revealed that Dreamhost has an interesting configuration for rails, such that rmagick version 1.6.0 is the one that gets used, but 1.10.1 is what’s reported installed. (in this case, 10>6 by about 2 years). The bug was that drawing text on an image stopped at the first space character. The solution was to freeze my copy of rmagick (1.10.1, just like theirs should have been) with this rake task. This might have been easier if it was not installed there in the first place, but then again, I never managed to build rmagick on my machine.
  • Rails, by default, appends a ?[big number] to static file urls. This generally breaks caching in web browsers, which are conditioned to not cache anything with a query string. In turn, this makes pages that include css, javascript and images seem very slow to load, especially if the rest of the page is lightweight. I’m sure that there are issues with stale versions of files, but completly breaking caching seems a bad way to fix it.

    It’s possible to disable this behavoir by editing the link generation code in vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb, commenting the line that starts “source << ‘?’ + rails_asset_id(source) ” I need a cleaner solution than that though…

  • The way to figure something out at Dreamhost is to submit a trouble ticket, then get annoyed enough that you go and google/hack at a solution because you’re frustrated that they’re not responding in 15 minutes late on a weekend.
  • Later… There’s a strange bug that when rmagick writes out a .png, it only writes 1024 bytes, but when Ruby’s file object attempts, it cleanly writes the whole file. Yay for one line fixes and 5 line comments.
No comments

No comments yet. Be the first.

Leave a reply

You must be logged in to post a comment.