Update: All problems described here have been resolved.
Recent versions of merb can now use the provided thor tasks to bundle merb, mongrel, and other gems with the source of the application, with the intent of making deployment easier. Merbunity has a nice introduction to this.
However, I’ve run into a couple of issues with this, and thought I’d document my experiences (I’m actually hoping that this post will be invalid a week from now, that all of these will have been fixed).
English
Update: The 0.3.1 gem installs just fine.
First, at some point this morning the english gem was updated to 0.3.0, and this version is broken. I always see the following error when attempting to install it, both globally and as part of a bundle:
ERROR: Error installing english:
english requires facets >=2.0.0
(>= 0, runtime)
Of course, I have facets 2.4.4 installed.
Solution
Run this before bundling merb using thor:
bin/thor merb:gems:install english --version='0.2.0'
Gems Cache
Update: This has been resolved. As of commit 7e2ce280621a0b712ee36b22520576d8905038bd, the merb-gen in merb-more does not place gems/cache/* in your .gitignore.
This is a more minor issue. When deploying to a different architecture, you want to run bin/thor merb:gems:redeploy. This requires the gems/cache directory to be present, but the .gitignore file provided by merb-gen ignores all the caches.
Solution
Simply remove the gems/cache/* line from your .gitignore file if present (and if you’re using git).
Shebang
Update: This has been resolved by the merb team. Running
thor merb:tasks:updatewill give you a merb.thor that uses /usr/bin/env ruby in the shebang line.
The shebang line placed in bin/thor, bin/merb, etc., is system-specific. In my case, the ruby path generated on my dev machine is completely non-existent on my server. This makes it impossible to execute bin/thor on the server, making it rather difficult to redeploy the gems (redeploying regenerates all the binary wrappers, so this is really only problematic on bin/thor).
Solution
There are two options here:
- Have thor installed on your server and don’t use bin/thor until after you run a redeploy
- Modify
#!#{Gem.ruby}in merb.thor (inexecutable_wrapper) to#!/usr/bin/env ruby. This one only works if all of your systems are unix-based, of course.