Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

mongrel_rails doesn't work w/ Rails 3 #50

Open
wants to merge 1 commit into from

2 participants

@notch8

Updated the code for starting the server to use the ./script/rails server command if it exists. That way we can support both the old way and a Rails 3 compatible way. Another advantage is that though it will use Mongrel if its available, we're not tied to that and can use Thin or fall back to Webrick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 26, 2011
  1. @orangewolf

    use script/server for Rails 3 apps send mongrel_rails command doesnt …

    orangewolf authored
    …work under mongrel 1.20pre2
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/webrat/selenium/application_servers/rails.rb
View
12 lib/webrat/selenium/application_servers/rails.rb
@@ -31,11 +31,19 @@ def pid_file
end
def start_command
- "mongrel_rails start -d --chdir='#{::Rails.root}' --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &"
+ if File.exists?(File.join(::Rails.root, 'script', 'rails'))
+ "cd #{::Rails.root} && ./script/rails server --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &"
+ else
+ "mongrel_rails start -d --chdir='#{::Rails.root}' --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &"
+ end
end
def stop_command
- "mongrel_rails stop -c #{::Rails.root} --pid #{pid_file}"
+ if File.exists?(File.join(::Rails.root, 'script', 'rails'))
+ "kill `cat #{pid_file}`"
+ else
+ "mongrel_rails stop -c #{::Rails.root} --pid #{pid_file}"
+ end
end
end
Something went wrong with that request. Please try again.