Clifton King <cliftonk at gmail.com> wrote:> I got a "The message''s content type was not explicitly allowed" when trying > to send an email to the group.Hi, we only allow plain text and patches on the mailing list, no HTML.> > From: Clifton King <cliftonk at gmail.com> > > To: mongrel-unicorn at rubyforge.org > > Date: Tue, 24 Aug 2010 12:21:49 -0500 > > Subject: Unicorn and home_run > > Hi All, > > > > I was trying to get home_run (a C-based Date/DateTime implementation) > > working with Unicorn http://github.com/jeremyevans/home_run, but using > > home_run --install then running unicorn_rails would crash with the following > > stack trace on a Ruby 1.8.7 CentOS staging server: > > http://pastie.org/1111144 > > > > I believe this has to do with the order in which ruby''s default libraries > > are loaded when running unicorn_rails. Jeremy Evans (home_run''s author) is > > available to answer any questions specific to his libraries.Are you starting it with "home_run unicorn_rails" or did you install it system-wide? Jeremy: would it be easier for home_run to just require the core-Ruby classes first and then monkey patch the methods individually? I haven''t gotten a chance to look into home_run myself much. -- Eric Wong
Eric, Starting it with "home_run unicorn_rails" does work. Using home_run --install and then unicorn_rails does not. We use preload_app in production and I doubt that anything except the home_run --install method would work for us. Using irb, script/server (mongrel), etc work fine using home_run --install. Thanks, Clifton On Tue, Aug 24, 2010 at 2:58 PM, Eric Wong <normalperson at yhbt.net> wrote:> > Clifton King <cliftonk at gmail.com> wrote: > > I got a "The message''s content type was not explicitly allowed" when trying > > to send an email to the group. > > Hi, we only allow plain text and patches on the mailing list, no HTML. > > > > From: Clifton King <cliftonk at gmail.com> > > > To: mongrel-unicorn at rubyforge.org > > > Date: Tue, 24 Aug 2010 12:21:49 -0500 > > > Subject: Unicorn and home_run > > > Hi All, > > > > > > I was trying to get home_run (a C-based Date/DateTime implementation) > > > working with Unicorn http://github.com/jeremyevans/home_run, but using > > > home_run --install then running unicorn_rails would crash with the following > > > stack trace on a Ruby 1.8.7 CentOS staging server: > > > http://pastie.org/1111144 > > > > > > I believe this has to do with the order in which ruby''s default libraries > > > are loaded when running unicorn_rails. Jeremy Evans (home_run''s author) is > > > available to answer any questions specific to his libraries. > > Are you starting it with "home_run unicorn_rails" or did you install > it system-wide? > > Jeremy: would it be easier for home_run to just require the core-Ruby > classes first and then monkey patch the methods individually? ?I haven''t > gotten a chance to look into home_run myself much. > > -- > Eric Wong
On Tue, Aug 24, 2010 at 12:58 PM, Eric Wong <normalperson at yhbt.net> wrote:> Clifton King <cliftonk at gmail.com> wrote: >> I got a "The message''s content type was not explicitly allowed" when trying >> to send an email to the group. > > Hi, we only allow plain text and patches on the mailing list, no HTML. > >> > From: Clifton King <cliftonk at gmail.com> >> > To: mongrel-unicorn at rubyforge.org >> > Date: Tue, 24 Aug 2010 12:21:49 -0500 >> > Subject: Unicorn and home_run >> > Hi All, >> > >> > I was trying to get home_run (a C-based Date/DateTime implementation) >> > working with Unicorn http://github.com/jeremyevans/home_run, but using >> > home_run --install then running unicorn_rails would crash with the following >> > stack trace on a Ruby 1.8.7 CentOS staging server: >> > http://pastie.org/1111144 >> > >> > I believe this has to do with the order in which ruby''s default libraries >> > are loaded when running unicorn_rails. Jeremy Evans (home_run''s author) is >> > available to answer any questions specific to his libraries. > > Are you starting it with "home_run unicorn_rails" or did you install > it system-wide?Clifton told me that was working for him. One of the reasons it may work where the other way didn''t is that in addition to setting up the load path, it also requires the library up front. I think this problem is solved in the master branch. The problem is that some libraries require date/format without requiring date. In the standard library date/format.rb does not require date, where it does in home_run. I believe the reason for this error is that previously, in date/format.rb, I was doing: require ''date'' unless defined?(Date) But if something opens up the Date class to monkey-patch, it never requires ''date'', since the Date class then exists. It appears that json, syck, and rubygems all do this. home_run now does: require ''date'' unless defined?(Date::ZONES) Which should fix the issue, as only home_run should be defining that.> Jeremy: would it be easier for home_run to just require the core-Ruby > classes first and then monkey patch the methods individually? ?I haven''t > gotten a chance to look into home_run myself much.home_run is designed as a complete replacement for the standard date library. It''s not a monkey patching solution like Date::Performance, so it wouldn''t be easier to just require and then overwrite. Jeremy
Jeremy Evans <jeremyevans0 at gmail.com> wrote:> > Are you starting it with "home_run unicorn_rails" or did you install > > it system-wide? > > Clifton told me that was working for him. One of the reasons it may > work where the other way didn''t is that in addition to setting up the > load path, it also requires the library up front.Yeah, I figured using the "home_run" wrapper would be less than ideal since it would get lost during exec upgrades and newer versions of home_run wouldn''t get picked up the same way it''d get picked up in a system install.> I think this problem is solved in the master branch.Thanks. I''d be eager to hear how it works out since this could be a popular library very soon :) Is there a home_run mailing list I could follow? -- Eric Wong
On Wed, Aug 25, 2010 at 12:50 AM, Eric Wong <normalperson at yhbt.net> wrote:> Jeremy Evans <jeremyevans0 at gmail.com> wrote: >> > Are you starting it with "home_run unicorn_rails" or did you install >> > it system-wide? >> >> Clifton told me that was working for him. ?One of the reasons it may >> work where the other way didn''t is that in addition to setting up the >> load path, it also requires the library up front. > > Yeah, I figured using the "home_run" wrapper would be less than > ideal since it would get lost during exec upgrades and newer > versions of home_run wouldn''t get picked up the same way it''d get > picked up in a system install.The home_run wrapper works by modifying the environment (RUBYLIB and RUBYOPT). Does the environment get reset during exec upgrades? You are correct that newer versions would not get picked up, as it''s going to hard code a specific gem version.>> I think this problem is solved in the master branch. > > Thanks. ?I''d be eager to hear how it works out since this could be a > popular library very soon :) Is there a home_run mailing list I could > follow?I haven''t set up a mailing list for it (you are the first person to ask about one), but I''ve been hanging out by myself in #home_run on freenode (IRC). Jeremy
Jeremy Evans <jeremyevans0 at gmail.com> wrote:> On Wed, Aug 25, 2010 at 12:50 AM, Eric Wong <normalperson at yhbt.net> wrote: > > Yeah, I figured using the "home_run" wrapper would be less than > > ideal since it would get lost during exec upgrades and newer > > versions of home_run wouldn''t get picked up the same way it''d get > > picked up in a system install. > > The home_run wrapper works by modifying the environment (RUBYLIB and > RUBYOPT). Does the environment get reset during exec upgrades?The environment is untouched by default. I meant Unicorn can only see $0 as ''unicorn'' or ''unicorn_rails'', and never ''home_run'', so the version changes can''t be picked up.> You are correct that newer versions would not get picked up, as it''s > going to hard code a specific gem version.> > Thanks. ?I''d be eager to hear how it works out since this could be a > > popular library very soon :) Is there a home_run mailing list I could > > follow? > > I haven''t set up a mailing list for it (you are the first person to > ask about one), but I''ve been hanging out by myself in #home_run on > freenode (IRC).Ah, I''ve mostly given up on IRC since I get distracted easily or everybody pops in at different times and lack of threading makes it hard to follow. I much prefer the asynchronous nature of email along with its ease of archival, search, and patch exchange. For intense emergencies where money is lost for every second something is awry, yes, IRC is great, but I do Free Software development at a much more relaxed pace :) -- Eric Wong