Permalink
Browse files

Fix console to accept [environment] [options] as specified in docs.

  • Loading branch information...
1 parent 3d44e45 commit 434d75705f84337c97c2e5360a7586c7373c923b @miloops miloops committed Apr 15, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/commands/console.rb
@@ -51,6 +51,6 @@ def start
end
# Has to set the RAILS_ENV before config/application is required
-if ARGV.first && !ARGV.first.index("-") && env = ARGV.pop # has to pop the env ARGV so IRB doesn't freak
+if ARGV.first && !ARGV.first.index("-") && env = ARGV.shift # has to shift the env ARGV so IRB doesn't freak
ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env
end

0 comments on commit 434d757

Please sign in to comment.