diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index 68982b9f52babca12be8883d524be5269cf86dc2..8957f11724fe2cbb0aa0316d5128e30b3c9ae901 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/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|