Some of development is done on Linux, some on Windows.
Depending on which OS the app is currently running on, it needs to load different config files.
Is there any “Rails way” to do so?
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the Ruby constant
RUBY_PLATFORMThe only gotcha is on JRuby, which lists
"java"as the RUBY_PLATFORM, no matter which OS it is. On windows there is win32, mingw32 or cygwin.Another solution is to use the sys_uname package from the sysutils gem, if the method above doesn’t fit your needs.