From fernand.galiana at gmail.com Tue Jan 2 10:44:39 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Tue, 2 Jan 2007 08:44:39 -0700 Subject: Caching... Message-ID: <30ab479c0701020744y6c0d0240x2deabec65ea316cf@mail.gmail.com> Hi, I am just starting playing with merb and was wondering if there is any caching strategy available. I was planning on using the action caching plugin but I am quiet sure what is the merb plan with dealing with plugins... Any idea or suggestions ? Regards, Fernand -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070102/360e2f70/attachment.html From ez at engineyard.com Tue Jan 2 11:10:22 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Tue, 2 Jan 2007 08:10:22 -0800 Subject: Caching... In-Reply-To: <30ab479c0701020744y6c0d0240x2deabec65ea316cf@mail.gmail.com> References: <30ab479c0701020744y6c0d0240x2deabec65ea316cf@mail.gmail.com> Message-ID: <240435BD-2D10-4760-A852-BAA552EDCAE5@engineyard.com> On Jan 2, 2007, at 7:44 AM, Fernand Galiana wrote: > Hi, > > I am just starting playing with merb and was wondering if there > is any caching > strategy available. I was planning on using the action caching > plugin but I am > quiet sure what is the merb plan with dealing with plugins... > > Any idea or suggestions ? > > Regards, > Fernand Hey Fernand- Right now the merb handler will look for cached pages in public/ just like rails page caching. If you request /foo/1 it will first look for /foo/1.html and render that instead of calling the controller. As far as action caching goes it is as yet unimplemented. I will take a look today at creating a compiled template cache and then we can go from there. I don't think that the action cache plugin will work without some major modifications. As a rule, any rails plugins that only add or alter Active Record models or are just helpers will usually work without many changes. But rails plugins that hook into action controller or action view just won't work out the box with merb since merb implements its own actionpack. Check in with me later today on the #merb irc channel onf irc.freenode.net and I will give you the scoop on how I want cachign to work in merb and I can get some feedback. Cheers -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From fernand.galiana at gmail.com Wed Jan 3 10:19:53 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Wed, 3 Jan 2007 08:19:53 -0700 Subject: Using helpers... Message-ID: <30ab479c0701030719r5b6ec16buda60200b29e7eae7@mail.gmail.com> All, I am getting an undefined method exception while trying to use a helper method in a xerb file. I am running version 0.0.8 module Merb module FredHelper def blee( args ) .... end end end In the xerb template I have xml.bobo blee( args ) At runtime I am getting undefined method 'blee' I tryied moving blee to global_helper as well but no dice.... What am I missing ? Regards, Fernand -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070103/8e6f2d15/attachment-0001.html From fernand.galiana at gmail.com Wed Jan 3 14:14:46 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Wed, 3 Jan 2007 12:14:46 -0700 Subject: Specifying load path... Message-ID: <30ab479c0701031114j4bd36230y63936a8b3a55817@mail.gmail.com> All, How can I specify a load path in merb ? I have some classes in a lib directory that needs to be in the load path. Not sure how to accomplish that with merb.... Thanks, Fernand -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070103/2c960f36/attachment.html From ez at engineyard.com Wed Jan 3 14:30:49 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Wed, 3 Jan 2007 11:30:49 -0800 Subject: Specifying load path... In-Reply-To: <30ab479c0701031114j4bd36230y63936a8b3a55817@mail.gmail.com> References: <30ab479c0701031114j4bd36230y63936a8b3a55817@mail.gmail.com> Message-ID: <22015C75-3FB0-43A1-8A3C-0CAC6360DF45@engineyard.com> On Jan 3, 2007, at 11:14 AM, Fernand Galiana wrote: > All, > > How can I specify a load path in merb ? I have some classes in a > lib directory that needs > to be in the load path. Not sure how to accomplish that with > merb.... > > Thanks, > Fernand > The dist/lib dir is already in the load path automatically. But if you are having trouble loading something the best thing to do is to either add to the load path or put in specific require statements in the dist/conf/merb_init.rb file -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From ez at engineyard.com Wed Jan 3 14:51:40 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Wed, 3 Jan 2007 11:51:40 -0800 Subject: Using helpers... In-Reply-To: <30ab479c0701030719r5b6ec16buda60200b29e7eae7@mail.gmail.com> References: <30ab479c0701030719r5b6ec16buda60200b29e7eae7@mail.gmail.com> Message-ID: On Jan 3, 2007, at 7:19 AM, Fernand Galiana wrote: > xml.bobo blee( args ) Hey Fernand- Sorry about that. I had not actually implemented the render_xml to take advantage of the helpers yet. SO I just sat down and fixed this for you. Please svn up to the latest merb trunk and it will work fine for you. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From fernand.galiana at gmail.com Wed Jan 3 19:51:05 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Wed, 3 Jan 2007 17:51:05 -0700 Subject: Using helpers... In-Reply-To: References: <30ab479c0701030719r5b6ec16buda60200b29e7eae7@mail.gmail.com> Message-ID: <30ab479c0701031651w2608d082h7772235cf3c6f6d2@mail.gmail.com> Thanks Ezra.... I have patch my merb install with the svn one but I am still seeing an issue with my helper as I am getting this in the log Missing Helper: Merb::DailyHelper I checked that this file was indeed in dist/app/helpers and it was correctly named daily_helper.rb and was set up as module Merb module DailyHelper .... end end What else could I be missing ? Is helpers not on the load path somehow ? -Fernand On 1/3/07, Ezra Zygmuntowicz wrote: > > > On Jan 3, 2007, at 7:19 AM, Fernand Galiana wrote: > > > xml.bobo blee( args ) > > Hey Fernand- > > Sorry about that. I had not actually implemented the render_xml to > take advantage of the helpers yet. SO I just sat down and fixed this > for you. Please svn up to the latest merb trunk and it will work fine > for you. > > Cheers- > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070103/9c922c21/attachment.html From fernand.galiana at gmail.com Fri Jan 12 11:30:19 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Fri, 12 Jan 2007 09:30:19 -0700 Subject: Rails session parasite... Message-ID: <30ab479c0701120830j36c8f937g3af5a17200832b1f@mail.gmail.com> All, I see this item on the merb-0.0.8 release notes Added rails session parasite mode. I am assuming merbs can piggy back off the rails current session. How does one achieve that ? Thanks Fernand -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070112/0803f46e/attachment.html From ez at engineyard.com Sun Jan 14 17:25:07 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Sun, 14 Jan 2007 14:25:07 -0800 Subject: Rails session parasite... In-Reply-To: <30ab479c0701120830j36c8f937g3af5a17200832b1f@mail.gmail.com> References: <30ab479c0701120830j36c8f937g3af5a17200832b1f@mail.gmail.com> Message-ID: On Jan 12, 2007, at 8:30 AM, Fernand Galiana wrote: > All, > > I see this item on the merb-0.0.8 release notes > Added rails session parasite mode. > > I am assuming merbs can piggy back off the rails current session. > How does one achieve that ? > > Thanks > Fernand > Hey Fernand- Yes to piggyback on rails sessions, you need to point merb's db connection at your rails database session table. Then in merb.yml you need to set :sql_session: true Then when you redirect to merb from rails you append the session id to the query string like : /merb/action?_session_id=asdkljfhaklsdfnaddanlafldlkdf Then you will be able to use the session has on merb and it will have the contents from rails. -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From fernand.galiana at gmail.com Mon Jan 15 21:40:23 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Mon, 15 Jan 2007 19:40:23 -0700 Subject: Rails session parasite... In-Reply-To: References: <30ab479c0701120830j36c8f937g3af5a17200832b1f@mail.gmail.com> Message-ID: <30ab479c0701151840q680a1cn2a8f2fa0d1581940@mail.gmail.com> Thank you all for replying... Now the key question here is how do I tell the session to persist before delegating to merb. It seems that the session gets persisted underneath the scene by rails and my session state gets out of wack between rails and merb. Thus if in my rails controller I have: def my_action session[:fred] = "blee" # call merb .... end The first time I hit my_action. Merb does not see fred.... Any ideas ?? On 1/14/07, Ezra Zygmuntowicz wrote: > > > On Jan 12, 2007, at 8:30 AM, Fernand Galiana wrote: > > > All, > > > > I see this item on the merb-0.0.8 release notes > > Added rails session parasite mode. > > > > I am assuming merbs can piggy back off the rails current session. > > How does one achieve that ? > > > > Thanks > > Fernand > > > > Hey Fernand- > > > Yes to piggyback on rails sessions, you need to point merb's db > connection at your rails database session table. Then in merb.yml you > need to set > :sql_session: true > > Then when you redirect to merb from rails you append the session > id > to the query string like : > > /merb/action?_session_id=asdkljfhaklsdfnaddanlafldlkdf > > Then you will be able to use the session has on merb and it will > have the contents from rails. > > > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070115/bc5ce250/attachment.html From ez at engineyard.com Mon Jan 15 22:29:37 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Mon, 15 Jan 2007 19:29:37 -0800 Subject: Rails session parasite... In-Reply-To: <30ab479c0701151840q680a1cn2a8f2fa0d1581940@mail.gmail.com> References: <30ab479c0701120830j36c8f937g3af5a17200832b1f@mail.gmail.com> <30ab479c0701151840q680a1cn2a8f2fa0d1581940@mail.gmail.com> Message-ID: <83B4DD2D-F8F5-4A03-8AFC-6EF64EFD320B@engineyard.com> On Jan 15, 2007, at 6:40 PM, Fernand Galiana wrote: > Thank you all for replying... > > Now the key question here is how do I tell the session to persist > before delegating > to merb. It seems that the session gets persisted underneath the > scene by rails and > my session state gets out of wack between rails and merb. > > Thus if in my rails controller I have: > > def my_action > session[:fred] = "blee" > > # call merb what does call merb do? You should do a redirect to merb. That way rails will finalize the sessions before merb gets the result. If that doesn't work then thereis a way to make the rails sessions flush but i can't recall what the method is right now. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From fernand.galiana at gmail.com Tue Jan 16 00:51:09 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Mon, 15 Jan 2007 22:51:09 -0700 Subject: Rails session parasite... In-Reply-To: <83B4DD2D-F8F5-4A03-8AFC-6EF64EFD320B@engineyard.com> References: <30ab479c0701120830j36c8f937g3af5a17200832b1f@mail.gmail.com> <30ab479c0701151840q680a1cn2a8f2fa0d1581940@mail.gmail.com> <83B4DD2D-F8F5-4A03-8AFC-6EF64EFD320B@engineyard.com> Message-ID: <30ab479c0701152151m14ee1d1y163b492df4fd8c72@mail.gmail.com> Hey Ezra, A redirect won't work as I need to return results from the merb call. Basically I am retrieving some xml from the rails action by calling merb. If you stumble upon the session flush/store call, please ping me back... Thanks, Fernand On 1/15/07, Ezra Zygmuntowicz wrote: > > > On Jan 15, 2007, at 6:40 PM, Fernand Galiana wrote: > > > Thank you all for replying... > > > > Now the key question here is how do I tell the session to persist > > before delegating > > to merb. It seems that the session gets persisted underneath the > > scene by rails and > > my session state gets out of wack between rails and merb. > > > > Thus if in my rails controller I have: > > > > def my_action > > session[:fred] = "blee" > > > > # call merb > > what does call merb do? You should do a redirect to merb. That way > rails will finalize the sessions before merb gets the result. If that > doesn't work then thereis a way to make the rails sessions flush but > i can't recall what the method is right now. > > Cheers- > > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070115/4633bd20/attachment.html From rogelio.samour at gmail.com Tue Jan 16 08:35:08 2007 From: rogelio.samour at gmail.com (Rogelio J. Samour) Date: Tue, 16 Jan 2007 07:35:08 -0600 Subject: Rails session parasite... In-Reply-To: References: <30ab479c0701120830j36c8f937g3af5a17200832b1f@mail.gmail.com> <30ab479c0701151840q680a1cn2a8f2fa0d1581940@mail.gmail.com> <83B4DD2D-F8F5-4A03-8AFC-6EF64EFD320B@engineyard.com> <30ab479c0701152151m14ee1d1y163b492df4fd8c72@mail.gmail.com> Message-ID: Fernand, If you're on the same domain, using rewrites at the frontend server level... then making calls to merb is no different than making calls to the rails app. For instance, http://myapp/files <-- there's a rewrite rule I have to proxy all requests to /files to my merb app... but from merb I can call methods from controllers in my rails app... since they both share the same domain. I hope I'm making sense. -Rogelio On 1/15/07, Fernand Galiana wrote: > Hey Ezra, > > A redirect won't work as I need to return results from the merb call. > Basically I am retrieving some xml from the rails action by calling merb. > If you stumble upon the session flush/store call, please ping me > back... > > Thanks, > Fernand > > On 1/15/07, Ezra Zygmuntowicz < ez at engineyard.com> wrote: > > > > > > On Jan 15, 2007, at 6:40 PM, Fernand Galiana wrote: > > > > > Thank you all for replying... > > > > > > Now the key question here is how do I tell the session to persist > > > before delegating > > > to merb. It seems that the session gets persisted underneath the > > > scene by rails and > > > my session state gets out of wack between rails and merb. > > > > > > Thus if in my rails controller I have: > > > > > > def my_action > > > session[:fred] = "blee" > > > > > > # call merb > > > > what does call merb do? You should do a redirect to merb. That way > > rails will finalize the sessions before merb gets the result. If that > > doesn't work then thereis a way to make the rails sessions flush but > > i can't recall what the method is right now. > > > > Cheers- > > > > -- Ezra Zygmuntowicz > > -- Lead Rails Evangelist > > -- ez at engineyard.com > > -- Engine Yard, Serious Rails Hosting > > -- (866) 518-YARD (9273) > > > > > > > > _______________________________________________ > Merb-devel mailing list > Merb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/merb-devel > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070116/7c19d9b7/attachment-0001.html From rogelio.samour at gmail.com Fri Jan 19 11:04:05 2007 From: rogelio.samour at gmail.com (Rogelio J. Samour) Date: Fri, 19 Jan 2007 10:04:05 -0600 Subject: Merb Init Script Message-ID: I'm trying to emulate the mongrel_cluster_ctl but it takes a -c conf_file option... meaning I can run it from anywhere as long as I tell it where the conf file is. Merb doesn't have that capability does it? (it has an additional/supplemental config like mup.conf etc) Do I have to be under the merb_app root /path/to/merb/app/ to be able to run merb? Let me know. Thanks, rogelio From ez at engineyard.com Fri Jan 19 14:35:48 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Fri, 19 Jan 2007 11:35:48 -0800 Subject: Merb Init Script In-Reply-To: References: Message-ID: <4C3E54CB-0A8F-4790-A56C-D49C06ECCAC7@engineyard.com> On Jan 19, 2007, at 8:04 AM, Rogelio J. Samour wrote: > I'm trying to emulate the mongrel_cluster_ctl but it takes a -c > conf_file option... meaning I can run it from anywhere as long as I > tell it where the conf file is. Merb doesn't have that capability does > it? (it has an additional/supplemental config like mup.conf etc) > > Do I have to be under the merb_app root /path/to/merb/app/ to be able > to run merb? > > Let me know. > > Thanks, > > rogelio No you don't have to be in the merb apps root. You can pass merb root as a command line flag: $ merb -m /path/to/merbapp Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From rogelio.samour at gmail.com Fri Jan 19 14:42:46 2007 From: rogelio.samour at gmail.com (Rogelio J. Samour) Date: Fri, 19 Jan 2007 13:42:46 -0600 Subject: Merb Init Script In-Reply-To: <4C3E54CB-0A8F-4790-A56C-D49C06ECCAC7@engineyard.com> References: <4C3E54CB-0A8F-4790-A56C-D49C06ECCAC7@engineyard.com> Message-ID: <1169235766.14090.4.camel@localhost> Correct but if I wanted to do a /etc/merb/merb_app1.yml and /etc/merb/merb_app2.yml each of which are symbolic links to each app's /path/to/dist/conf/merb.yml Then I could do a /etc/init.d/merb restart and restart all of merb apps. I guess my question would be: is this a good idea and a possible one? -rjs- On Fri, 2007-01-19 at 11:35 -0800, Ezra Zygmuntowicz wrote: > On Jan 19, 2007, at 8:04 AM, Rogelio J. Samour wrote: > > > I'm trying to emulate the mongrel_cluster_ctl but it takes a -c > > conf_file option... meaning I can run it from anywhere as long as I > > tell it where the conf file is. Merb doesn't have that capability does > > it? (it has an additional/supplemental config like mup.conf etc) > > > > Do I have to be under the merb_app root /path/to/merb/app/ to be able > > to run merb? > > > > Let me know. > > > > Thanks, > > > > rogelio > > > No you don't have to be in the merb apps root. You can pass merb > root as a command line flag: > > $ merb -m /path/to/merbapp > > > Cheers- > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > From ez at engineyard.com Fri Jan 19 14:47:46 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Fri, 19 Jan 2007 11:47:46 -0800 Subject: Merb Init Script In-Reply-To: <1169235766.14090.4.camel@localhost> References: <4C3E54CB-0A8F-4790-A56C-D49C06ECCAC7@engineyard.com> <1169235766.14090.4.camel@localhost> Message-ID: <4306D61F-BA40-40B2-B1B4-BA6CB464493B@engineyard.com> Do you have more then one merb app? I usually don't like to put more then one app per init.d script. But if you do need to put them all in one init.d script. I think the best way woudl be top place a shell script somewhere that can start all yoru merbs appropriately. ANd then just have the init.d script call that shell script. Or even better yet, use monit instead of init.d scripts ;) -Ezra On Jan 19, 2007, at 11:42 AM, Rogelio J. Samour wrote: > Correct but if I wanted to do a /etc/merb/merb_app1.yml > and /etc/merb/merb_app2.yml each of which are symbolic links to each > app's /path/to/dist/conf/merb.yml > > Then I could do a /etc/init.d/merb restart and restart all of merb > apps. > > I guess my question would be: is this a good idea and a possible one? > > -rjs- > > On Fri, 2007-01-19 at 11:35 -0800, Ezra Zygmuntowicz wrote: >> On Jan 19, 2007, at 8:04 AM, Rogelio J. Samour wrote: >> >>> I'm trying to emulate the mongrel_cluster_ctl but it takes a -c >>> conf_file option... meaning I can run it from anywhere as long as I >>> tell it where the conf file is. Merb doesn't have that capability >>> does >>> it? (it has an additional/supplemental config like mup.conf etc) >>> >>> Do I have to be under the merb_app root /path/to/merb/app/ to be >>> able >>> to run merb? >>> >>> Let me know. >>> >>> Thanks, >>> >>> rogelio >> >> >> No you don't have to be in the merb apps root. You can pass merb >> root as a command line flag: >> >> $ merb -m /path/to/merbapp >> >> >> Cheers- >> -- Ezra Zygmuntowicz >> -- Lead Rails Evangelist >> -- ez at engineyard.com >> -- Engine Yard, Serious Rails Hosting >> -- (866) 518-YARD (9273) >> >> > -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From rogelio.samour at gmail.com Fri Jan 19 14:53:29 2007 From: rogelio.samour at gmail.com (Rogelio J. Samour) Date: Fri, 19 Jan 2007 13:53:29 -0600 Subject: Merb Init Script In-Reply-To: <4306D61F-BA40-40B2-B1B4-BA6CB464493B@engineyard.com> References: <4C3E54CB-0A8F-4790-A56C-D49C06ECCAC7@engineyard.com> <1169235766.14090.4.camel@localhost> <4306D61F-BA40-40B2-B1B4-BA6CB464493B@engineyard.com> Message-ID: <1169236409.14090.6.camel@localhost> Ha! OK. I guess I could just write one init.d script that starts and stops the _one_ merb app I have in that box. I was just thinking in future terms. thanks though! -rjs- On Fri, 2007-01-19 at 11:47 -0800, Ezra Zygmuntowicz wrote: > Do you have more then one merb app? I usually don't like to put more > then one app per init.d script. But if you do need to put them all in > one init.d script. I think the best way woudl be top place a shell > script somewhere that can start all yoru merbs appropriately. ANd > then just have the init.d script call that shell script. > > Or even better yet, use monit instead of init.d scripts ;) > > -Ezra > > > On Jan 19, 2007, at 11:42 AM, Rogelio J. Samour wrote: > > > Correct but if I wanted to do a /etc/merb/merb_app1.yml > > and /etc/merb/merb_app2.yml each of which are symbolic links to each > > app's /path/to/dist/conf/merb.yml > > > > Then I could do a /etc/init.d/merb restart and restart all of merb > > apps. > > > > I guess my question would be: is this a good idea and a possible one? > > > > -rjs- > > > > On Fri, 2007-01-19 at 11:35 -0800, Ezra Zygmuntowicz wrote: > >> On Jan 19, 2007, at 8:04 AM, Rogelio J. Samour wrote: > >> > >>> I'm trying to emulate the mongrel_cluster_ctl but it takes a -c > >>> conf_file option... meaning I can run it from anywhere as long as I > >>> tell it where the conf file is. Merb doesn't have that capability > >>> does > >>> it? (it has an additional/supplemental config like mup.conf etc) > >>> > >>> Do I have to be under the merb_app root /path/to/merb/app/ to be > >>> able > >>> to run merb? > >>> > >>> Let me know. > >>> > >>> Thanks, > >>> > >>> rogelio > >> > >> > >> No you don't have to be in the merb apps root. You can pass merb > >> root as a command line flag: > >> > >> $ merb -m /path/to/merbapp > >> > >> > >> Cheers- > >> -- Ezra Zygmuntowicz > >> -- Lead Rails Evangelist > >> -- ez at engineyard.com > >> -- Engine Yard, Serious Rails Hosting > >> -- (866) 518-YARD (9273) > >> > >> > > > > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > From rogelio.samour at gmail.com Tue Jan 23 16:47:59 2007 From: rogelio.samour at gmail.com (Rogelio J. Samour) Date: Tue, 23 Jan 2007 15:47:59 -0600 Subject: Merb Init Script In-Reply-To: <1169236409.14090.6.camel@localhost> References: <4C3E54CB-0A8F-4790-A56C-D49C06ECCAC7@engineyard.com> <1169235766.14090.4.camel@localhost> <4306D61F-BA40-40B2-B1B4-BA6CB464493B@engineyard.com> <1169236409.14090.6.camel@localhost> Message-ID: OK. Here's the deal: merb -m /path/to/merb/app does not work like I expect. Meaning, it starts merb with the defaults and not with whatever is in MERB_ROOT/dist/conf/merb.yml ... I looked at the lib/merb/merb_server.rb code and the options hash is never loaded again (with the merb.yml) after the initial setup method. This setup method tries to load merb.yml based on the PWD which is not the merb_app root. Check out the patch which adds a -z or --merb-config /path/to/merbapp/dist/conf/merb.yml [From the patch]: + # Added by: Rogelio J. Samour 2007-01-23 + # We need to reload the options that exist in the App's merb.yml + # This is needed when one calls merb NOT from the merb_app ROOT + # like so: merb --merb-config /path/to/dist/conf/merb.yml -m /path/to/merb/app + # or if we add :merb_root: /path/to/merb/app in the merb.yml we can now only call it + # like so: merb --merb-config /path/to/dist/conf/merb.yml This allows me to potentially have several merb apps running on a server... then I can create symlinks to /etc/merb/ and loop through those... starting and stopping those... I also attached an init.d script that does this for just one merb app for now... but can be easily hacked into multiple. :) Let me know what you guys think. Good or bad. You won't hurt my feelings. thanks & laters, -rogelio- On 1/19/07, Rogelio J. Samour wrote: > > Ha! OK. I guess I could just write one init.d script that starts and > stops the _one_ merb app I have in that box. I was just thinking in > future terms. > > thanks though! > > -rjs- > > On Fri, 2007-01-19 at 11:47 -0800, Ezra Zygmuntowicz wrote: > > Do you have more then one merb app? I usually don't like to put > more > > then one app per init.d script. But if you do need to put them all in > > one init.d script. I think the best way woudl be top place a shell > > script somewhere that can start all yoru merbs appropriately. ANd > > then just have the init.d script call that shell script. > > > > Or even better yet, use monit instead of init.d scripts ;) > > > > -Ezra > > > > > > On Jan 19, 2007, at 11:42 AM, Rogelio J. Samour wrote: > > > > > Correct but if I wanted to do a /etc/merb/merb_app1.yml > > > and /etc/merb/merb_app2.yml each of which are symbolic links to each > > > app's /path/to/dist/conf/merb.yml > > > > > > Then I could do a /etc/init.d/merb restart and restart all of merb > > > apps. > > > > > > I guess my question would be: is this a good idea and a possible one? > > > > > > -rjs- > > > > > > On Fri, 2007-01-19 at 11:35 -0800, Ezra Zygmuntowicz wrote: > > >> On Jan 19, 2007, at 8:04 AM, Rogelio J. Samour wrote: > > >> > > >>> I'm trying to emulate the mongrel_cluster_ctl but it takes a -c > > >>> conf_file option... meaning I can run it from anywhere as long as I > > >>> tell it where the conf file is. Merb doesn't have that capability > > >>> does > > >>> it? (it has an additional/supplemental config like mup.conf etc) > > >>> > > >>> Do I have to be under the merb_app root /path/to/merb/app/ to be > > >>> able > > >>> to run merb? > > >>> > > >>> Let me know. > > >>> > > >>> Thanks, > > >>> > > >>> rogelio > > >> > > >> > > >> No you don't have to be in the merb apps root. You can pass merb > > >> root as a command line flag: > > >> > > >> $ merb -m /path/to/merbapp > > >> > > >> > > >> Cheers- > > >> -- Ezra Zygmuntowicz > > >> -- Lead Rails Evangelist > > >> -- ez at engineyard.com > > >> -- Engine Yard, Serious Rails Hosting > > >> -- (866) 518-YARD (9273) > > >> > > >> > > > > > > > -- Ezra Zygmuntowicz > > -- Lead Rails Evangelist > > -- ez at engineyard.com > > -- Engine Yard, Serious Rails Hosting > > -- (866) 518-YARD (9273) > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070123/424ee1b3/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: add_merb_conf.patch Type: text/x-patch Size: 1999 bytes Desc: not available Url : http://rubyforge.org/pipermail/merb-devel/attachments/20070123/424ee1b3/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: merb_init Type: application/octet-stream Size: 1003 bytes Desc: not available Url : http://rubyforge.org/pipermail/merb-devel/attachments/20070123/424ee1b3/attachment-0001.obj