aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/actions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators/actions.rb')
-rw-r--r--railties/lib/rails/generators/actions.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb
index 7dec4d446a..a31932906d 100644
--- a/railties/lib/rails/generators/actions.rb
+++ b/railties/lib/rails/generators/actions.rb
@@ -1,5 +1,6 @@
require 'open-uri'
require 'active_support/deprecation'
+require 'rbconfig'
module Rails
module Generators
@@ -240,7 +241,7 @@ module Rails
def rake(command, options={})
log :rake, command
env = options[:env] || 'development'
- sudo = options[:sudo] && RUBY_PLATFORM !~ /mswin|mingw/ ? 'sudo ' : ''
+ sudo = options[:sudo] && Config::CONFIG['host_os'] !~ /mswin|mingw/ ? 'sudo ' : ''
in_root { run("#{sudo}#{extify(:rake)} #{command} RAILS_ENV=#{env}", :verbose => false) }
end
@@ -307,7 +308,7 @@ module Rails
# Add an extension to the given name based on the platform.
#
def extify(name)
- if RUBY_PLATFORM =~ /mswin|mingw/
+ if Config::CONFIG['host_os'] =~ /mswin|mingw/
"#{name}.bat"
else
name