views:

13

answers:

0

I'm trying to deploy a small rails3 app to a FreeBSD host using capistrano and bundler. I have added the line

require 'bundler/capistrano'

to my deploy.rb file, and bundler seems to work fine until it comes to the mysql2 gem. Here the install fails because the install script uses chmod and chgrp to try to install the gem with root:wheel as it's owner. This fails and I'm stuck with a half installed app.

I tried to trick bundler into using the system wide version of the mysql2 gem like this:

group :production do
  gem 'mysql2', :path => "/usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.6"
end

group :development, :test do
  gem 'mysql2'
end

But this is not allowed by bundler, and I can't leave the path in the development mode, as the setup for the development machines are completely different.

Has anybody had any luck getting the mysql2 gem work with a bundler/capistrano setup on FreeBSD?