Posts Tagged ‘rails’

April 19 2009

Windows, Rails 2.2+, InstantRails & MySQL: bundled mysql.rb driver error

by Hang

If you get the error:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please
install the mysql gem and try again: gem install mysql.
rake aborted!

Here’s what happened.

Windows, InstantRails & Rails 2.2+ will not work out of the box

gem install mysql will successfully install the gem but then silently fail if the gem cannot find MySQL. Because InstantRails is designed to install cleanly, it doesn’t modify your path and so gems cannot find the MySQL path. To fix this, go to Control Panel->System->Advanced System Settings->Environment Variables->Path and add C:InstantRailsmysqlbin & C:InstantRailsrubybin to the path. Restart everything that can be restarted and try again.

Windows, Ruby, MySQL 5.1 & Rails 2.2+ will not work out of the box.

Install MySQL 5.0 instead.

either of these should fix the problem.

February 7 2009

Rails without Rails

by Hang

After working for a while on my first non-web based ruby project, I’ve tried to integrate nicely with a number of different components which I was already familiar with within the rails environment like ActiveRecord. Having struggled a bit with the pure approach, I wouldn’t reccomend it.

Instead, what I’m doing is just spinning up an empty rails instance and just ignoring all the web based stuff. That is, I’m not spinning up a passenger instance, my app folder is empty but I can still access everything else inside Rails like:

  • ActiveRecord
  • Migrations and rake tasks
  • ruby script/console so I can interactively poke at the db
  • ruby script/runner to spin up my server
  • All the rails based testing frameworks

So even though it’s a bit more messy, it ends up saving a lot of hassle in the long run. So much for modular design huh?

Oct 19th (day 7): Rails Rumble done

by Hang

Discovered a rather unpleasant surprise. I assumed Rails Rumble was ending at midnight PDT, turns out it was actually midnight GMT which meant we were scrambling over the last 8 hours to get everything done. Anyway, a somewhat function version of the site is up at:

http://dontsendit.r08.railsrumble.com/

Site is definately very barebones and lacking in decent design/features at the moment.

Oct 18th (day 6): Conceptualising dontsendit

by Hang

We’re spending the weekend at bumblebeelabs working on a project called dontsendit as part of the Rails Rumble. The concept of dontsendit is very simple: what if we could write emails and set conditions so that they are sent only if you fail to do something? How would that change the dynamics and nuance of email?

As a concept, dontsendit is fairly technically trivial. There’s only 3 major pages and it shouldn’t take more than a few lines of code. Where the real challenge has been for us is that, while it’s easy for us to tell people how it works, it’s been tough to explain what it can do for them. There’s a major cognitive leap from “I have a problem” to “dontsendit is the perfect solution for it” and practically noone can make that leap unaided.

The problem is, dontsendit could be used for potentially quite a number of different things. Some of them more compelling than others. One of the tricky design arguments we’ve been having is whether to go for general but bland (aka: the swiss army knife approach) or specific but opinionated (the scalpel approach). There’s much to be said for both sides which is what makes it a perennial topic for debate but my gut instinct is that general but bland sounds seductive at first but will ultimately fail.

Anyway, keep an eye out for dontsendit.com, the final version should be launching by midnight tomorrow. I wouldn’t try testing it before then unless you want your emails to be publically viewable. It’s still very much a work in progress.

August 19 2008

Rails 2.0 + SWFUpload + RESTful authentication

by Hang

Just a note on changes in Rails 2.0 which messes up a couple of tutorials on getting SWFUpload working with restful authentication.

The gist of it is that Flash cannot send cookie data so if you’re using a cookie based authentication mechanism, it will fail. The solution is to insert the session id into the query string and then hack CGI::Session to set the session id. A lot of tutorials have you insert this snippet into either environment.rb or lib/ but this no longer works with Rails 2.0+. Instead, you need to put it in the config/initializers folder.

Knowing that would have saved me about 5 hours worth of frustration.

Copyright ©2009 BumblebeeLabs — Theme designed by Michael Amini