To edit pages or tickets please login with username/password: aaf/aaf

Ticket #185 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

[PATCH] ferret_server does not play nicely with capistrano 2.1

Reported by: aaf Assigned to: jk
Priority: major Milestone: 0.5
Component: 0plugin Version: 1.0
Keywords: capistrano ferret_server Cc:

Description

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 line 39 of 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

Attachments

ferret_server_with_capistrano-2.1.patch (1.3 kB) - added by aaf on 11/28/07 22:30:12.
Gets ferret_server to play nicely with capistrano 2.1

Change History

11/28/07 22:30:12 changed by aaf

  • attachment ferret_server_with_capistrano-2.1.patch added.

Gets ferret_server to play nicely with capistrano 2.1

12/16/07 20:32:51 changed by jk

  • status changed from new to closed.
  • resolution set to fixed.

fixed in trunk. Thanks!

To edit pages or tickets please login with username/password: aaf/aaf