This project is archived and is in readonly mode.

#5527 ✓resolved
Akira Matsuda

rails console loads "production" env with "t" argument

Reported by Akira Matsuda | September 2nd, 2010 @ 04:32 AM | in 3.x

The console command regards the environment argument as the following:

% rails console t
Loading production environment (Rails 3.0.0)
>> Rails.env
=> "production"
% rails console d
Loading production environment (Rails 3.0.0)
>> Rails.env
=> "production"

This behavior is caused by this logic:

%w(production development test).find { |e| e.index(env) }
because both 't' and 'd' are included in 'production'.

I guess this is not intentional, so attached a patch to forward match the argument.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>


Referenced by