Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Display RAILS_ENV in script/console

#2641

to avoid stupid errors (yes, we all need some sleep sometimes), I think we should display the current env in the rails console.

I've set this in my .irbrc file :

# Prompts
IRB.conf[:PROMPT][:CUSTOM] = { 
  :PROMPT_N => "[#{ENV["RAILS_ENV"].capitalize}]>> ",
  :PROMPT_I => "[#{ENV["RAILS_ENV"].capitalize}]>> ",
  :PROMPT_S => nil,
  :PROMPT_C => "?> ",
  :RETURN => "=> %s\n"
}   

# Set default prompt
IRB.conf[:PROMPT_MODE] = :CUSTOM

So it displays :

[Development]>> 1+1
=> 2

Maybe this could be included in ./railties/lib/commands/console.rb ?

Thanks

Reported by Gravis · May 13th, 2009 @ 02:10 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to wontfix

    I don't really see much value keeping this in core. 99% times people are always on the development shell.

    Thanks.

    May 17th, 2009 @ 01:28 PM

  2. Gravis
    Gravis

    "99% times people are always on the development shell." Wow, are you sure ? Am I the only person to use the console in staging / preproduction / production mode ?

    May 17th, 2009 @ 01:31 PM