#53 ✓resolved
Jens

[PATCH] ferret_server does not play nicely with capistrano 2.1

Reported by Jens | February 13th, 2010 @ 12:38 AM

Capistrano is unable to start and stop the new ferret_server script. An example capistrano task might look like:

namespace :ferret do
  namespace :server do
    task :stop, :role => :app do
      rails_env = fetch(:rails_env, 'production')
      run "cd #{latest_release}; script/ferret_server --environment=#{rails_env} stop"
    end
  end
end

It fails with errors like...

no such file to load -- /bin/../config/environment

./script/../vendor/plugins/acts_as_ferret/lib/server_manager.rb:39:in @require'
./script/../vendor/plugins/acts_as_ferret/lib/server_manager.rb:39
script/ferret_server:4:in @require'
script/ferret_server:4

It's caused by [source:/trunk/plugin/acts_as_ferret/lib/server_manager.rb@280#L39 line 39] of [source:/trunk/plugin/acts_as_ferret/lib/server_manager.rb@280 server_manager.rb]. It tries to find the location of

config/environment.rb
using
ENV['']
, which works fine under normal circumstances (with
ENV['']
equal to
script/ferret_server
). With capistrano, however,
ENV['_']
equals
/bin/sh
.

My patch is a quick workaround that adds a

--root
option to the command line that allows you to specify the exact location of your project.

My new ferret recipe looks like...

namespace :ferret do
  namespace :server do
    task :stop, :role => :app do
      rails_env = fetch(:rails_env, 'production')
      run "cd #{latest_release}; script/ferret_server --root=#{latest_release} --environment=#{rails_env} stop"
    end
  end
end

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Pages