Today, the Rails team finally released the first beta of Rails 3. Trying to play around with it, I experienced a very annoying problem with mongrel:
Per default, Rails seems to only work with the gems listed in its Gemfile, which means that it starts using webrick. I wanted it to use mongrel, like Rails 2 does and added gem "mongrel"
to my gemfile which resulted in rails server
just freezing. The cuplrit was some of the weirdest piece of code I’ve ever seen, mongrel’s Mongrel::Gems.require
function:
def require(library, version = nil)
begin
Kernel.require library
rescue LoadError, RuntimeError => e
begin
# ActiveSupport breaks 'require' by making it always return a true value
Kernel.require 'rubygems'
version ? gem(library, version) : gem(library)
retry
rescue Gem::LoadError, LoadError, RuntimeError
# puts "** #{library.inspect} could not be loaded" unless library == "mongrel_experimental"
end
end
end
An infinite loop with the only way out being an exception that never got thrown!
This madness was called from mongrel.rb:
$LOAD_PATH.unshift 'projects/mongrel_experimental/lib/'
Mongrel::Gems.require 'mongrel_experimental', ">=#{Mongrel::Const::MONGREL_VERSION}"
Removing these two lines solved the issue. That would have meant patching my gems however, and that smells like something you should not do. The final solution was simple and posted in the comments of the Rails 3 Beta announcement by Juanma Cervera. I just needed to add 3 more lines to my Gemfile:
gem "mongrel"
gem "cgi_multipart_eof_fix"
gem "fastthread"
gem "mongrel_experimental"
Continue reading
This week, I’ll roll out a major update to REST in Place. I have completely restructured the code and made the Plugin much more object-oriented, modular and maintainable. Existing installations should be able to upgrade without a hitch. The most important change for users will be the jQuery 1.4 support and support for different editors (such as textarea, checkbox, etc.).
In November I got some pull requests for REST in Place which I didn’t get to really have a look at until last week. I haven’t really touched REST in Place in ages and wasn’t really aware that it was that popular. It has 72 followers and 11 forks on github and who knows how many other people are just silently using it! So, I merged in the contributions and dealt with some issues in the tracker and thought about how to go on.
REST in Place originally was a mere proof of concept and one of my first projects in JavaScript and jQuery. I have since written a lot more complicated applications and even a diploma thesis on JavaScript and the old code just isn’t up to my standards anymore. Additionally I have received several pull requests for textarea support which all couldn’t be merged because they were just copypasted and modified a little from the input-tag version. The only solution was a complete rewrite and that’s what I did. While the plugin still works the same way, the code is properly split up and more modular now. This enables easy extension and maintenance from now on and hopefully quicker development from me and better patches from all users.
This new development has some drawbacks too, unfortunately. This massive improvement will only go to the jQuery version of REST in Place. Since I don’t know much about Prototype or mootools, I can’t support both versions anymore. If someone is willing to work with me on this, I’ll happily accept their contributions but I can’t do this on my own. If anyone is willing to do so, please reply in the comments, so we can work out a plan. I want to keep all three versions as similar as possible, this means the Prototype and mootools versions should follow the same object-oriented structure as the jQuery version.
One last thing: I will support jQuery < 1.4 until 1.4.1 comes out. 1.4 introduced some very nice changes which I’d like to make use of but since 1.4 seems a little buggy still, I’ll continue to support the older versions for a little while.
Continue reading
I’m using a US-keyboard since the German layout hides the important characters needed by programmers all the time behind impossible three-finger gestures.
To be able to quickly enter umlauts on the US keyboard, I’ve been using the USGerman layout found here. In Snow Leopard, this layout bundle causes a horrible bug in the keychain, essentially preventing you from doing anything that requires your password.
To work around that, I created a new layout bundle from scratch using Ukelele. It works just as well and doesn’t crash the keychain.
You can find it on my github page: http://github.com/janv/usgerman/
Continue reading



Berlin always fascinates me. I’ve wanted to live and work there since I was a child.
My parents got to know each other and still have friends in Moabit.
Because of that I’ve been visiting the city almost every year of my life.
This year was the first time I brought my D90 and D40 with me.
The city has a different vibe, depending on the season and the places you see.
These three images capture how the city felt last week.
Continue reading