Permalink
Browse files

Make db console work for all versions of ruby on Windows.

[#3999 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 176fbfd commit e813ad2a42549e308a69fd9473f1b9ed531a0d7e unknown committed with jeremy Apr 25, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 railties/lib/rails/commands/dbconsole.rb
View
3 railties/lib/rails/commands/dbconsole.rb
@@ -1,6 +1,7 @@
require 'erb'
require 'yaml'
require 'optparse'
+require 'rbconfig'
module Rails
class DBConsole
@@ -41,7 +42,7 @@ def start
def find_cmd(*commands)
dirs_on_path = ENV['PATH'].to_s.split(File::PATH_SEPARATOR)
- commands += commands.map{|cmd| "#{cmd}.exe"} if RUBY_PLATFORM =~ /win32/
+ commands += commands.map{|cmd| "#{cmd}.exe"} if Config::CONFIG['host_os'] =~ /mswin|mingw/
full_path_command = nil
found = commands.detect do |cmd|

0 comments on commit e813ad2

Please sign in to comment.