#72
Sep 24, 2007

Adding an Environment

Rails comes with three environments: development, test, and production. But, you aren't restricted to just these. You can add your own! See how in this episode.
Download (7.1 MB, 3:22)
alternative download for iPod & Apple TV (4.9 MB, 3:22)
# database.yml
staging:
  adapter: mysql
  database: store_staging
  user: root
  password:
  host: localhost
# environments/staging.rb
config.log_level = :debug
mysqladmin create store_staging -u root -p
rake db:migrate RAILS_ENV=staging
script/server -e staging

RSS Feed for Episode Comments -2 comments

1. seb Sep 24, 2007 at 01:16

Great cast!
It would be great to see how to setup capistrano to use staging environment may be the next screencasts :)


2. Rich Cavanaugh Sep 24, 2007 at 06:38

I don't know about Capistrano but, I do have a solution for staging environments using Vlad on my blog.


3. Chris Barnes Oct 23, 2007 at 22:11

I've been using a custom environment for beta testing and it works really well. I can have beta testers using an edge version of my code while the production users data is unaffected. I can also give beta testers more info in their error messages.


4. Matt Nov 02, 2007 at 11:09

Thanks for the tip.

One thing that made me curious enough to dig thru the initializer code was the bit on having to set the config.log_level = :debug. This isn't necessary. The initializer only sets the log level to :info if the environment == 'production'. Otherwise, all other environments are set to :debug


5. Anthony Ettinger Nov 13, 2008 at 15:45

Look at the multistage plugin for capistrano, it will work nicely with additional environments.


6. Ash McKenzie Jan 18, 2009 at 16:19

Just found that you cannot use the underscore character (and possibly others) in the environment name.

I was after development_home, but had to settle for developmenthome.


7. ginger Sep 12, 2009 at 06:10

www.luxurykick.com wholesale and export latest and best brand name sports shoes such as nike air Jordan flight 45, 2009 Jordan foamposite lite, Air Jordan Schoolin’ Ray Allen, Jordan Jump man Pro, Jordan CP3 shoes, Jordan Melo M5, Jordan Trunner Q4 shoes, Jordan True Flight, Jordan M5 and Q4 mix, Jordan 09 Memory Version, Nike Michael Jackson etc. We also sell high quality replica handbags, jeans, jewelry, Gucci belts, Louis Vuitton belts, Ed hardy belts, Gucci caps, Louis Vuitton caps, Fendi caps etc. You can just contact us luxurykick at gmail dot com or add our msn luxurykick at hotmail dot com for details. Tks!
Looking forward to a mutually beneficial business relationship with you!
Website: www.luxurykick.com
MSN: luxurykick@hotmail.com
Gmail: luxurykick@gmail.com
Email: luxurykick@yahoo.com
 


8. gol Oct 22, 2009 at 05:38

antikrizisnoe-upravlenie.ru/


9. chanel series Jul 27, 2010 at 00:45

We are in great honor to introduce you this chanel pumps.All of them are in great quality and cheap price.Free shipping and fast delivery can be offered.


10. free directory list Aug 11, 2010 at 22:22

It is marvellous! I like it!


11. Coach Outlet Aug 12, 2010 at 03:43

Here we have new style Coach Handbags.All the Coach purses are good quality and lower price.A fashion Coach Outlet is dreamed by the fashion females.Welcome to our store discountbagshop.com.I am sure you will find one for yourself.


12. 90x workout Aug 12, 2010 at 09:21

Your blog appears quite informative. I liked it. So much useful material. I read with great interest.Can you please tell me how can I read your rss blog?


13. louis vuitton shoes Aug 26, 2010 at 21:10

Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets


14. snow boots Aug 31, 2010 at 00:56

I can have beta testers using an edge version of my code while the production users data is unaffected.


15. louis vuitton sunglasses Sep 01, 2010 at 21:19

I agree with your Blog and I will be back to check it more in the future so please keep up your work. I love your content & the way that you write. It looks like you’ve been doing this for a while now, how long have you been blogging for?

Add your comment:

(SKIP THIS ONE)

(required)

(not shown)


(use pastie or gist for code)

sponsored by:
if you want to help:
required:
Get Quicktime Player
Give Back to Open Source