Skip to content
Browse files

Merged pull request #278 from miloops/fix_console.

Fix console to accept [environment] [options] as specified in docs.
  • Loading branch information...
2 parents 922fb1d + 7d2f472 commit 8dcaf4db55eef6cd5758d9e46a1c00baefa2cb81 @josevalim josevalim committed Apr 26, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/commands/console.rb
View
2 railties/lib/rails/commands/console.rb
@@ -47,6 +47,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 8dcaf4d

Please sign in to comment.
Something went wrong with that request. Please try again.