Being Careful with Rails Session Data

Posted by Scott on Mar 21st, 2007

In the book Agile Web Development with Rails, it is recommended that you move your HTTP session data from temp files (the default) into your database for speed and scalability. One problem this can create if you’re stuffing lots of data into your sessions is that database fields are of a limited size. MySQL uses text as the default type for the data column.

I ran into some limitations regarding this earlier this week, and the surefire symptom of it is the error “marshal data too short” in your logs. Fortunately, a quick Google search resulted in a few clear answers. I even found a migration example to change the column type from text to mediumtext (you can also use longtext if you’re really paranoid).

PDF 2007 Conference

Posted by Scott on Mar 17th, 2007

No, this has nothing to do with Adobe’s document format. I’m talking about the Personal Democracy Forum, being held at Pace University in New York City. I’ll be there on Friday, May 18. The theme of the conference is something I’m becoming significantly involved in – the impact of technology in politics, grassroots activism, and elections.

I’m particularly looking forward to attending the presentations by Seth Godin and Craig Newmark. Political blogging is certainly playing a huge role in politics these days, but I’m less interested in that than I am in the more general aspects of community building and the nuts-and-bolts methods of leveraging software to empower motivated grassroots groups. It should be really interesting.

Migrating Your Rails App From 1.2.2 to 1.2.3

Posted by Scott on Mar 16th, 2007

For those of you updating your rails apps from v1.2.2 to v1.2.3 (released a couple of days ago), here’s all you need to change:

config/boot.rb, line 6:

unless RUBY_PLATFORM =~ /(:?mswin|mingw)/

config/environment.rb, line 8:

RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION

That’s it.

NHRuby.org Meeting March 20: Security and Cryptography in Ruby and Rails

Posted by Scott on Mar 10th, 2007

Attention local Rubyists! The third meeting of the NHRuby.org user group is coming up soon. This month we’ll have Brian DeLacey speaking about using crypto algorithms in your Ruby code. He’ll be demonstrating the Crypt library, which is written entirely in Ruby.

The objective of this meeting is two-fold: to address some interesting Ruby techniques and also walk through the basic structure and operations of a Rails application. We’ll have some Ruby and Rails books to raffle off at the end of the meeting – special thanks to O’Reilly Media.

Brian is an excellent speaker and has been making the rounds giving talks at many user groups in the Boston area. Mark your calendars, you won’t want to miss this presentation!

WHEN: Tuesday, March 20, 2007. 7-9 PM.
WHERE: Portsmouth Public Library, Hilton Garden Inn Meeting Room (2nd floor), Portsmouth, NH.

For more details, including a map of the meeting location, see our upcoming meetings page on the wiki.

Migrating Your Rails App From 1.1.6 to 1.2.2

Posted by Scott on Mar 3rd, 2007

The two Rails apps I’ve been working on were started when v1.1.6 was the latest stable version of Rails. I’ve wanted to fully transition them to the new 1.2.2 release, and have been kind of sitting around waiting for someone to write up exactly what all the differences are that need to be merged into your project to upgrade. Since this apparently hasn’t happened (I’ve done some intensive Googling for it), I finally broke down and migrated the projects myself.

I didn’t document every single change I made, but below I’ll list the files that you’ll want to diff and merge if you want to do this yourself:


README
app/controllers/application.rb
config/boot.rb
config/environment.rb
config/routes.rb
config/environments/production.rb
public/404.html
public/500.html
public/javascripts/controls.js
public/javascripts/dragdrop.js
public/javascripts/effects.js
public/javascripts/prototype.js
script/process/inspector

The files in app/ and config/ had to be merged by hand, but the rest I just copied over from a freshly created rails project. Now I’m rolling with the latest version of prototype and can sleep better knowing that my projects are running in a fully complaint Rails 1.2.2 environment.

Update: kain in #rubyonrails noted that you can do a “rake update:javascripts” to cleanly update your javascript assets.

Blog Badges



[FSF Associate Member]

Archives