Permalink
Browse files

Use mongrel_rails as the command for the mongrel gem

  • Loading branch information...
nilbus committed Sep 7, 2011
1 parent c51a96b commit 8fef49fda13fae891a5f01a59cc26610a8b68843
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/capistrano/ext/windows_server.rb
@@ -12,8 +12,8 @@
set :use_sudo, false
# We can't run ruby commands directly, because the rake script searches for ruby based on windows paths that aren't valid in this environment
- def ruby_cmd(cmd)
- "PATH=\"#{File.dirname ruby_exe_path}:$PATH\" #{ruby_exe_path} -e \"require 'rubygems'; gem '#{cmd}', '>= 0'; load Gem.bin_path('#{cmd}', '#{cmd}', '>= 0')\""
+ def ruby_cmd(gem, cmd=gem)
+ "PATH=\"#{File.dirname ruby_exe_path}:$PATH\" #{ruby_exe_path} -e \"require 'rubygems'; gem '#{gem}', '>= 0'; load Gem.bin_path('#{gem}', '#{cmd}', '>= 0')\""
end
def rubygems_cmd
@@ -106,15 +106,15 @@ def rubygems_cmd
task :setup do
mongrel_instances.each do |n|
run "mkdir -p #{current_path}/{tmp,log}" # These are often not under version control, but their absence keeps mongrel from recognizing the rails app
- run "cd #{current_path} && #{ruby_cmd 'mongrel'} service::install -e #{rails_env} -N #{mongrel_instance_prefix}#{n} -p #{base_port + n - mongrel_instances.first}; true"
+ run "cd #{current_path} && #{ruby_cmd 'mongrel', 'mongrel_rails'} service::install -e #{rails_env} -N #{mongrel_instance_prefix}#{n} -p #{base_port + n - mongrel_instances.first}; true"
run %Q(sc.exe config "#{mongrel_instance_prefix}#{n}" start= auto; true)
end
end
desc "Remove mongrel services"
task :remove do
mongrel_instances.each do |n|
- run "#{ruby_cmd 'mongrel'} service::remove -N #{mongrel_instance_prefix}#{n}; true"
+ run "#{ruby_cmd 'mongrel', 'mongrel_rails'} service::remove -N #{mongrel_instance_prefix}#{n}; true"
end
end

0 comments on commit 8fef49f

Please sign in to comment.