Maxime Calay
2010-Dec-20 13:16 UTC
How to start application from cmd.exe at windows startup ???
Hello, I searched three hours how to start my RoR application automatically as windows starts. No information about this on internet. Maybe it''s too easy. Not for me ! I have installed InstantRails2.0 and i know there is a menu to start command prompt with ruby, but how to access this command prompt in command line from cmd.exe ??? If i run cmd.exe, then go to rails app directory and type "ruby script/server" it doesn''t work because "ruby" command is not recognized. I need to start automatically my ruby application at windows startup (session) ! Thank you for your answers Max -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Dec-20 14:07 UTC
Re: How to start application from cmd.exe at windows startup?
Maxime Calay wrote in post #969556:> Hello, > > I searched three hours how to start my RoR application automatically as > windows starts.That depends on what you are using for a Web server.> No information about this on internet.Sure there is, but you''re looking in the wrong place. You should be looking at your Web server software''s docs; there''s little or nothing Rails-specific here. [...]> If i run cmd.exe, then go to rails app directory and type "ruby > script/server" it doesn''t work because "ruby" command is not recognized. > > I need to start automatically my ruby application at windows startup > (session) !Why do you need to do this in the first place, instead of using a real server? (And why are you making your life harder by using Windows?)> > Thank you for your answers > > MaxBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jiten Bhagat
2010-Dec-20 14:22 UTC
Re: How to start application from cmd.exe at windows startup ???
Hello Max, In order to get the "ruby" command recognised, you need to add the location of the ruby executable to your PATH. The best thing is to add the "bin" folder of your InstantRails (which contains ruby, rake, etc.) to your PATH. Best thing is to search Google on how to add things to PATH. Cheers, Jits On 20/12/2010 13:16, Maxime Calay wrote:> Hello, > > I searched three hours how to start my RoR application automatically > as windows starts. No information about this on internet. Maybe it''s > too easy. Not for me ! > > I have installed InstantRails2.0 and i know there is a menu to start > command prompt with ruby, but how to access this command prompt in > command line from cmd.exe ??? > > If i run cmd.exe, then go to rails app directory and type "ruby > script/server" it doesn''t work because "ruby" command is not recognized. > > I need to start automatically my ruby application at windows startup > (session) ! > > Thank you for your answers > > Max > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Dec-20 14:25 UTC
Re: How to start application from cmd.exe at windows startup ???
On 20 December 2010 13:16, Maxime Calay <maxime.calay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I searched three hours how to start my RoR application automatically as > windows starts. No information about this on internet. Maybe it''s too easy. > Not for me ! > > I have installed InstantRails2.0 and i know there is a menu to start command > prompt with ruby, but how to access this command prompt in command line from > cmd.exe ??? > > If i run cmd.exe, then go to rails app directory and type "ruby > script/server" it doesn''t work because "ruby" command is not recognized.The question is not really how to start your rails app, but how to start an InstantRails app from outside the IR environment. I did achieve this many moons ago before I saw the light and moved to Ubuntu (I seriously suggest you look at this possibility, you are unlikely to regret it. There are several ways of runnning both Windows and Ubuntu on the same machine). I forget how I did it, but I think I looked in the IR folders and found some batch files which when I looked inside them saw how the IR environment is setup. I think it then became clear what to do. Alternatively, if no-one here knows how to do it then further googling, with InstantRails as one of the keywords may be the only possibility. I do know that IR has not been updated for some time and is probably not the best way (even on windows) of running RoR. VirtualRails has been recommended if you absolutely have to stick with Windows. As I type this I see that it has been suggested that adding the ruby folder to the path may be sufficient, I suspect that is not all there is to it. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling
2010-Dec-20 14:34 UTC
Re: How to start application from cmd.exe at windows startup ???
On 20 December 2010 14:22, Jiten Bhagat <lists-DYnhOvfiKYO1Qrn1Bg8BZw@public.gmane.org> wrote:> The best thing is to add the "bin" folder of your InstantRails (which > contains ruby, rake, etc.) to your PATH.I disagree. The "best" thing to do is to not use a development platform to try to host production sites - Don''t use InstantRails for live. If you *have* to use Windows, then look at the Bitnami Rubystack... it''s moved on a bit since InstantRails stopped being developed. Regards, Michael -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling
2010-Dec-20 14:36 UTC
Re: How to start application from cmd.exe at windows startup ???
On 20 December 2010 13:16, Maxime Calay <maxime.calay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I searched three hours how to start my RoR application automatically as > windows starts. No information about this on internet. Maybe it''s too easy. > Not for me !Where were you searching? Google for "ruby rails windows service" and you get lots of results :-/ -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jiten Bhagat
2010-Dec-20 15:00 UTC
Re: How to start application from cmd.exe at windows startup ???
On 20/12/2010 14:34, Michael Pavling wrote:> On 20 December 2010 14:22, Jiten Bhagat<lists-DYnhOvfiKYO1Qrn1Bg8BZw@public.gmane.org> wrote: >> The best thing is to add the "bin" folder of your InstantRails (which >> contains ruby, rake, etc.) to your PATH. > I disagree. The "best" thing to do is to not use a development > platform to try to host production sites - Don''t use InstantRails for > live.Totally agree with that. It wasn''t clear to me whether the OP wanted to host something in production or just have a Rails app available on startup on their local machine (e.g.: a local instance of Redmine). So my suggestion was merely in the context of the OP''s question, and was also one step (of many) on the path to getting familiar with using Ruby. As others have suggested, I too would highly recommend not using Windows for any Ruby development work. Having moved to Fedora then Ubuntu after 2 years of Ruby dev on Windows I can safely say I have regained some of my sanity back :)> If you *have* to use Windows, then look at the Bitnami Rubystack... > it''s moved on a bit since InstantRails stopped being developed.Good suggestion; +1 Jits> Regards, > Michael >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Norm Scherer
2010-Dec-20 18:01 UTC
Re: How to start application from cmd.exe at windows startup ???
Maxime Calay wrote:> Hello, > > I searched three hours how to start my RoR application automatically > as windows starts. No information about this on internet. Maybe it''s > too easy. Not for me ! > > I have installed InstantRails2.0 and i know there is a menu to start > command prompt with ruby, but how to access this command prompt in > command line from cmd.exe ??? > > If i run cmd.exe, then go to rails app directory and type "ruby > script/server" it doesn''t work because "ruby" command is not recognized. > > I need to start automatically my ruby application at windows startup > (session) ! > > Thank you for your answers > > Max > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en.There are a number of ways to do this. One way I have used is to set up a couple of .bat files that run from startup. start_mysql.bat PATH C:\InstantRails\mysql\bin;%PATH% mysqld start_app.bat CD C:\InstantRails\rails_apps\my_app PATH C:\InstantRails\ruby\bin;C:\InstantRails\mysql\bin;%PATH% ruby script\server -e production To start your server from cmd.exe, just run ''use_ruby.cmd'' found in the InstantRails directory and then cd app and ''ruby script/server'' You can also set up mysql and mongrel_rails to run as services but that is fairly complex but doable. I do it from an installer so I would have to extract the relevant stuff if you are interested. Let me know if you want to see that. Norm -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rajinder Yadav
2010-Dec-20 19:01 UTC
Re: Re: How to start application from cmd.exe at windows startup?
On Mon, Dec 20, 2010 at 9:07 AM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Maxime Calay wrote in post #969556: >> Hello, >> >> I searched three hours how to start my RoR application automatically as >> windows starts. > > That depends on what you are using for a Web server. > >> No information about this on internet. > > Sure there is, but you''re looking in the wrong place. You should be > looking at your Web server software''s docs; there''s little or nothing > Rails-specific here. > > [...] >> If i run cmd.exe, then go to rails app directory and type "ruby >> script/server" it doesn''t work because "ruby" command is not recognized.are you possibly using rails 3? if so you should use, "rails server" i assume you want to run your rails app in development mode, for production you should seek other solutions, look into apache + mod passenger>> I need to start automatically my ruby application at windows startup >> (session) ! > > Why do you need to do this in the first place, instead of using a real > server? (And why are you making your life harder by using Windows?) > >> >> Thank you for your answers >> >> Max > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > Sent from my iPhone > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Maxime
2010-Dec-21 20:35 UTC
Re: How to start application from cmd.exe at windows startup ???
Hello and thanks to all for your answers, I couldn''t expect so many answers after a single day ! I need to run this application on Windows because it''s not on a server but in a desktop computer in office used as workstation. I finally found a file in the "instantrail" root folder (d''ont know why not before...) : use_ruby.cmd which loads PATH as you told me So from this i created a batch file loaded at windows startup with this PATH and commands to start my ruby application. I know there is a strong active RoR community which could help me in the future if needed. Best, Max On 20 déc, 14:16, Maxime Calay <maxime.ca...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I searched three hours how to start my RoR application automatically as > windows starts. No information about this on internet. Maybe it''s too easy. > Not for me ! > > I have installed InstantRails2.0 and i know there is a menu to start command > prompt with ruby, but how to access this command prompt in command line from > cmd.exe ??? > > If i run cmd.exe, then go to rails app directory and type "ruby > script/server" it doesn''t work because "ruby" command is not recognized. > > I need to start automatically my ruby application at windows startup > (session) ! > > Thank you for your answers > > Max-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Dec-21 20:50 UTC
Re: How to start application from cmd.exe at windows startup?
Maxime wrote in post #969877:> Hello and thanks to all for your answers, I couldn''t expect so many > answers after a single day ! > > I need to run this application on Windows because it''s not on a server > but in a desktop computer in office used as workstation. >Why are you running a Rails application in that sort of context (unless it''s for development)? And even in that case, I''d strongly urge the use of a *nix VM. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Dec-21 21:04 UTC
Re: Re: How to start application from cmd.exe at windows startup?
On 21 December 2010 20:50, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Maxime wrote in post #969877: >> Hello and thanks to all for your answers, I couldn''t expect so many >> answers after a single day ! >> >> I need to run this application on Windows because it''s not on a server >> but in a desktop computer in office used as workstation. >> > > Why are you running a Rails application in that sort of context (unless > it''s for development)?I do this also (on Ubuntu though, not Windows of course). I have several apps that I run as if they were desktop apps on my PC. One displays data from my weather station for example. A cron task updates the database from the weather station and the rails app displays the data and provides administrative operations. A conventional desktop application might be more efficient but doing it this way gives me the option of putting the database and the app on a server which would then allow access via the internet. Colin> > And even in that case, I''d strongly urge the use of a *nix VM. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > Sent from my iPhone > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Amit Tomar
2010-Dec-28 06:36 UTC
Re: How to start application from cmd.exe at windows startup?
Maxime you can your rails application as a window service if you are on wondows machine.There are two exe''s that comes with windows tool kit wih name srvany.exe and instsrv.exe .You can use them to create a windows servcie something like below... C:\Program Files\Resource Kit\Instsrv.exe railsapps C:\Program Files\Resource Kit\Srvany.exe The above command will create a windows service with name railsapps ,but it just dummy it would not do anything.You have to follow below steps to make it work for you. [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\railsapps\Parameters] Application=ruby AppParameters=script\server -b 192.168.247.49 -p 3000 AppDirectory=D:\work\railsapps -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.