You could use the rails runner and do something like

# add rails bin dir to path first!
RAILS_ENV=`rails runner "puts Rails.env"`

That said, if this is something you need access to regularly, add
initializer code to your app to write the end out to a well know file
name under the project that scripts can read without the overhead of
spinning up the app to get that info, scraping logs, etc

Max

On 2/13/12, Rafi A <rafigl...@gmail.com> wrote:
> Hi All,
>
> I want to get the environment name in which the application is executing
> whether in production or in development etc using the bash script and want
> to write that result into the .sh file. Not by using the ruby. Any ideas of
> how to get this work?
>
> --
> Cheers,
> Rafi
> *In Every moment, thank God.*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to