Is it possible to configure rails application to make rails console behave different in different environment? For example: on production i would like rails console to have one set of colours, but on localhost (development mode) a completely different one. Is it even possible, or maybe rails console cannot be configured from application level?
Asked
Active
Viewed 205 times
2 Answers
2
Include in Gemfile:
gem 'some_formatting_gem_name', :group => :development
While starting, mention environment as well.
RAILS_ENV=development bundle exec rails console
Or:
bundle exec rails console development

SreekanthGS
- 988
- 5
- 12
-
nice but i need it to be done WITHOUT mentioning the environment while starting console. thats kinda the point, to be able to differ environments – Leo May 09 '14 at 08:10
-
Have an environment set system wide. In your bash profile or bashrc include `export RAILS_ENV=environment_name`. – SreekanthGS May 09 '14 at 08:10
0
you can open your console in different environments (if that what you were asking for)
Simply use:
rails c [environment]
Eg.
rails c development

shivam
- 16,048
- 3
- 56
- 71