Re: Rails parameter question...

2012-03-17 Thread Dan Croak
Peeking into the Rails 2.3.8, params parsing is handled by
ActionContoller::ParamsParser, which is located in
actionpack/lib/action_controller/params_parser.rb:

https://github.com/rails/rails/blob/240f4e944cd90fca138aba8467456043952110cc/actionpack/lib/action_controller/params_parser.rb

ParamsParser is a Rack app which is autoloaded inside the
ActionController module:

https://github.com/rails/rails/blob/240f4e944cd90fca138aba8467456043952110cc/actionpack/lib/action_controller.rb#L60

So, I think you want a Rack app as Jeff suggested:

 class CustomXmlHandler
def self.call(env)
  if env[PATH_INFO] =~ /^\/big-xml-requests/
DatabaseObject.create :xml = request.raw_post
[201, {Content-Type = text/html}, XML saved]
  else
[404, {Content-Type = text/html}, Not Found]
  end
end
  end

Then, insert it as middleware before the built-in Rails params parser
in config/environment.rb:

configuration.middleware.insert_before ActionContoller::ParamsParser,
CustomXmlHandler

On Sat, Mar 17, 2012 at 7:26 PM, Jeff Schmitz
jeffrey.j.schm...@gmail.com wrote:
 Can you do this part as a rack app?

 Jeff

 On Mar 17, 2012, at 4:32 PM, Carson  Gross carsongr...@gmail.com wrote:

 According to my tests, yes, the parameter parsing happens before the
 before_filters are run.

 Thanks,
 Carson

 On Mar 17, 11:15 am, Jeff Schmitz jeffrey.j.schm...@gmail.com wrote:
 Does Rails parse the body prior to any before_filters run?

 Jeff

 On Mar 17, 2012, at 12:57 PM, Carson  Gross carsongr...@gmail.com wrote:







 Hey Guys,

 This is a rails question, so please ignore if that doesn't interest
 you.

 Does anyone know if there is a way to make rails *not* parse the body
 of an XML post to a given controller method?  I've been googling for
 an hour now and can't figure it out.  Basically we've got some huge
 XML docs coming in and we'd like to just jam them into the database as
 text and then process them in the background using nokogiri.

 Unfortunately, rails is still parsing them using REXML before they
 ever hit our controller which I just realized after a week of pulling
 my hair out: the perf issue doesn't show up in New Relic because all
 the processing time is *before* the request.

 We could switch the body to something like CSV, but I'm hoping there
 is a way to tell rails to just not bother parsing the body, so we can
 just grab it with:

  request.body.read

 This is rails 2.3.8.

 Thanks,
 Carson

 --
 You received this message because you are subscribed to the Google Groups 
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to 
 heroku+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/heroku?hl=en.

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


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


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



Re: push without restart

2011-08-08 Thread Dan Croak
You could try a script like Kumade and patch it so that it always does
a restart after migrating:

https://github.com/thoughtbot/kumade

On Mon, Aug 8, 2011 at 2:42 PM, John Beynon j...@beynon.org.uk wrote:
 This isn't something that has affected myself but in selling Heroku to the
 other devs at my workplace one thing that people dislike about the Heroku
 workflow is that the application is restarted after a code push before
 migrations may have been run. They are used a Capistrano style deployment
 when the the code is pushed, migrations run and then the app restarted.
 What should I tell them to alleviate concerns? I'd have thought use
 maintenance mode, deploy the code, do the work and then migrate it then
 bring the application back up -
 Any one else have any thoughts?
 John.


 --
 You received this message because you are subscribed to the Google Groups
 Heroku group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/heroku/-/ozy2gnNXQtoJ.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to
 heroku+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/heroku?hl=en.


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



Re: Problems with Hoptoad

2011-05-19 Thread Dan Croak
Hi Michael,

I imagine that the addon is no longer listed because of the EOL of the
Hoptoad Beta addon. Did you receive an email recently from Heroku like
the one below my signature?

You shouldn't have received an application error from Hoptoad, though.
We'll look into that.

Dan Croak
thoughtbot, makers of Hoptoad

-

Dear Hoptoad User,

A couple of months ago we emailed you regarding the Hoptoad Add-on's
move from Beta to GA, and the subsequent discontinuation of the free
 beta plan.

Our records indicate that you're still using the beta plan on the
following apps:

startup-map

To continue using Hoptoad in your apps, we kindly ask that you upgrade
 to either of the available Hoptoad plans immediately:

Hoptoad Basic ($2/month): heroku addons:upgrade hoptoad:basic

Hoptoad Plus ($7/month): heroku addons:upgrade hoptoad:plus

Should you wish to remove the add-on from your app, you can do so
with:

heroku addons:remove hoptoad

If you do not take any action, we will automatically be removing
the Hoptoad Beta EOL plan from all remaining apps on May 16th.
Apps using Hoptoad Basic or Plus will not be affected.

Best,

The Heroku Add-ons Team

On Thu, May 19, 2011 at 5:03 AM, Michel Pigassou dag...@gmail.com wrote:
 Hi.
 I've just submitted a ticket but I wonder if I'm the only one having
 problems with Hoptoad.
 First, the addon is no longer listed in my app addons.
 And in my logs there is:
 2011-05-19T08:51:33+00:00 app[web.1]: ** [Hoptoad] Failure:
 Net::HTTPInternalServerError
 2011-05-19T08:51:33+00:00 app[web.1]: ** [Hoptoad] Environment Info: [Ruby:
 1.9.2] [Rails: 3.0.4] [Env: production]
 2011-05-19T08:51:33+00:00 app[web.1]: ** [Hoptoad] Response from Hoptoad:
 2011-05-19T08:51:33+00:00 app[web.1]: ?xml version=1.0 encoding=UTF-8?
 2011-05-19T08:51:33+00:00 app[web.1]: errors
 2011-05-19T08:51:33+00:00 app[web.1]:   errorApplication Error/error
 2011-05-19T08:51:33+00:00 app[web.1]: /errors

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


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



Re: Mobile strategy

2011-03-18 Thread Dan Croak
I'm using mobile-fu on a few Rails apps on Heroku:

https://github.com/brendanlim/mobile-fu

It does device detection by checking the user agent against a giant regex.

It also provides a mobile mime type so you can put your mobile-specific views 
in their own foo.mobile.erb views if you want.

On Mar 18, 2011, at 6:01 AM, railsnerd rails.n...@gmail.com wrote:

 Hi there
 
 Is anyone using Heroku to serve a mobile and desktop version of their
 site?
 
 How to handle device detection?  Particularly when using the some URLs
 to deliver different markup/content to the two different platforms.
 
 Any ideas of a device detection strategy?  Even if it was just
 mobile or desktop (as opposed to detecting specific handsets).
 
 cheers
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to 
 heroku+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/heroku?hl=en.
 

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



Re: amazon simple email service + heroku

2011-02-07 Thread Dan Croak
Amazon has now removed the email address verification requirement of the
Reply-To header. Sweet!

On Fri, Feb 4, 2011 at 12:53 PM, Dan Croak dcr...@thoughtbot.com wrote:

 The only problem we've seen so far is not being able to use the Reply-To
 header because THAT email address must be verified:

 https://forums.aws.amazon.com/thread.jspa?messageID=220892

 That's the typical pattern where your app always sends email (never on
 behalf of another user), but you set the sending user's email to the
 Reply-To header so the receiver can just reply normally.

 We decided to remove the Reply-To feature for now.

 On Fri, Feb 4, 2011 at 12:51 PM, Dan Croak dcr...@thoughtbot.com wrote:

 That doesn't appear to be true once you've moved out of their sandbox and
 into the production environment. I just tested this a few seconds ago,
 sending an email via Amazon SES from a Rails app to an email that has never
 received an SES email before.

 The user received only the email from my app, no opt-in email from Amazon.

 On Fri, Feb 4, 2011 at 12:21 PM, Miles Smith mi...@vimae.com wrote:

 I've tried SES and it has an extremely crippling requirement:

 Every email must opt-in to recieve an email from SES. If you attempt to
 authorize an email account, Amazon sends out a very non-descriptive, cryptic
 (for normal users) message that states that Amazon SES would like to send
 email to you. It doesn't say anything about my app, nor did I find any way
 of modifying the message that's sent.

 Still not ready to replace my current email solution with them for that.
 :(

 On Fri, Feb 4, 2011 at 8:21 AM, Tim Fletcher m...@tfletcher.com wrote:

  2) Any sign of a Ruby library?
  Currently only .NET, Java and PHP wrappers.

 Yes, there's one here:
https://github.com/drewblas/aws-ses

 This might help if you're using Rails 3:

 http://robots.thoughtbot.com/post/3105121049/delivering-email-with-amazon-ses-in-a-rails-3-app

 Cheers,
 Tim

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




 --


 Miles Smith
 *Owner/Lead Developer*
 http://vimae.com/

 This e-mail and any files transmitted with it are confidential and
 intended solely for the use of the individual or individuals to whom the
 e-mail is addressed. This e-mail and any files transmitted with it may
 contain confidential, proprietary or legally privileged information. No
 confidentiality or privilege is waived or lost by any mistransmission. If
 you are not the intended recipient of this e-mail, please immediately notify
 the sender and delete and/or destroy the e-mail (along with any files
 transmitted with it) and all electronic or hard copies from your system. You
 should not, directly or indirectly, use, disclose, distribute, print, or
 copy any part of this message if you are not the intended recipient.

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





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



Re: amazon simple email service + heroku

2011-02-04 Thread Dan Croak
The only problem we've seen so far is not being able to use the Reply-To
header because THAT email address must be verified:

https://forums.aws.amazon.com/thread.jspa?messageID=220892

That's the typical pattern where your app always sends email (never on
behalf of another user), but you set the sending user's email to the
Reply-To header so the receiver can just reply normally.

We decided to remove the Reply-To feature for now.

On Fri, Feb 4, 2011 at 12:51 PM, Dan Croak dcr...@thoughtbot.com wrote:

 That doesn't appear to be true once you've moved out of their sandbox and
 into the production environment. I just tested this a few seconds ago,
 sending an email via Amazon SES from a Rails app to an email that has never
 received an SES email before.

 The user received only the email from my app, no opt-in email from Amazon.

 On Fri, Feb 4, 2011 at 12:21 PM, Miles Smith mi...@vimae.com wrote:

 I've tried SES and it has an extremely crippling requirement:

 Every email must opt-in to recieve an email from SES. If you attempt to
 authorize an email account, Amazon sends out a very non-descriptive, cryptic
 (for normal users) message that states that Amazon SES would like to send
 email to you. It doesn't say anything about my app, nor did I find any way
 of modifying the message that's sent.

 Still not ready to replace my current email solution with them for that.
 :(

 On Fri, Feb 4, 2011 at 8:21 AM, Tim Fletcher m...@tfletcher.com wrote:

  2) Any sign of a Ruby library?
  Currently only .NET, Java and PHP wrappers.

 Yes, there's one here:
https://github.com/drewblas/aws-ses

 This might help if you're using Rails 3:

 http://robots.thoughtbot.com/post/3105121049/delivering-email-with-amazon-ses-in-a-rails-3-app

 Cheers,
 Tim

 --
 You received this message because you are subscribed to the Google Groups
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to
 heroku+unsubscr...@googlegroups.comheroku%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/heroku?hl=en.




 --


 Miles Smith
 *Owner/Lead Developer*
 http://vimae.com/

 This e-mail and any files transmitted with it are confidential and
 intended solely for the use of the individual or individuals to whom the
 e-mail is addressed. This e-mail and any files transmitted with it may
 contain confidential, proprietary or legally privileged information. No
 confidentiality or privilege is waived or lost by any mistransmission. If
 you are not the intended recipient of this e-mail, please immediately notify
 the sender and delete and/or destroy the e-mail (along with any files
 transmitted with it) and all electronic or hard copies from your system. You
 should not, directly or indirectly, use, disclose, distribute, print, or
 copy any part of this message if you are not the intended recipient.

  --
 You received this message because you are subscribed to the Google Groups
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to
 heroku+unsubscr...@googlegroups.comheroku%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/heroku?hl=en.




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



Re: amazon simple email service + heroku

2011-02-04 Thread Dan Croak
Instructions for requesting production access are here:

http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/index.html?InitialSetup.Customer.html

About three minutes after we submitted the form requesting access, an actual
human from Amazon called us to verify. By the time we hung up the phone, we
had production access.

On Fri, Feb 4, 2011 at 12:54 PM, Miles Smith mi...@vimae.com wrote:

 

 How does one remove themselves from the sandbox?

 On Fri, Feb 4, 2011 at 9:51 AM, Dan Croak dcr...@thoughtbot.com wrote:

 That doesn't appear to be true once you've moved out of their sandbox and
 into the production environment. I just tested this a few seconds ago,
 sending an email via Amazon SES from a Rails app to an email that has never
 received an SES email before.

 The user received only the email from my app, no opt-in email from Amazon.

 On Fri, Feb 4, 2011 at 12:21 PM, Miles Smith mi...@vimae.com wrote:

 I've tried SES and it has an extremely crippling requirement:

 Every email must opt-in to recieve an email from SES. If you attempt to
 authorize an email account, Amazon sends out a very non-descriptive, cryptic
 (for normal users) message that states that Amazon SES would like to send
 email to you. It doesn't say anything about my app, nor did I find any way
 of modifying the message that's sent.

 Still not ready to replace my current email solution with them for that.
 :(

 On Fri, Feb 4, 2011 at 8:21 AM, Tim Fletcher m...@tfletcher.com wrote:

  2) Any sign of a Ruby library?
  Currently only .NET, Java and PHP wrappers.

 Yes, there's one here:
https://github.com/drewblas/aws-ses

 This might help if you're using Rails 3:

 http://robots.thoughtbot.com/post/3105121049/delivering-email-with-amazon-ses-in-a-rails-3-app

 Cheers,
 Tim

 --
 You received this message because you are subscribed to the Google
 Groups Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to
 heroku+unsubscr...@googlegroups.comheroku%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/heroku?hl=en.




 --


 Miles Smith
 *Owner/Lead Developer*
 http://vimae.com/

 This e-mail and any files transmitted with it are confidential and
 intended solely for the use of the individual or individuals to whom the
 e-mail is addressed. This e-mail and any files transmitted with it may
 contain confidential, proprietary or legally privileged information. No
 confidentiality or privilege is waived or lost by any mistransmission. If
 you are not the intended recipient of this e-mail, please immediately notify
 the sender and delete and/or destroy the e-mail (along with any files
 transmitted with it) and all electronic or hard copies from your system. You
 should not, directly or indirectly, use, disclose, distribute, print, or
 copy any part of this message if you are not the intended recipient.

  --
 You received this message because you are subscribed to the Google Groups
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to
 heroku+unsubscr...@googlegroups.comheroku%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/heroku?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to
 heroku+unsubscr...@googlegroups.comheroku%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/heroku?hl=en.




 --


 Miles Smith
 *Owner/Lead Developer*
 http://vimae.com/

 This e-mail and any files transmitted with it are confidential and intended
 solely for the use of the individual or individuals to whom the e-mail is
 addressed. This e-mail and any files transmitted with it may contain
 confidential, proprietary or legally privileged information. No
 confidentiality or privilege is waived or lost by any mistransmission. If
 you are not the intended recipient of this e-mail, please immediately notify
 the sender and delete and/or destroy the e-mail (along with any files
 transmitted with it) and all electronic or hard copies from your system. You
 should not, directly or indirectly, use, disclose, distribute, print, or
 copy any part of this message if you are not the intended recipient.

  --
 You received this message because you are subscribed to the Google Groups
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to
 heroku+unsubscr...@googlegroups.comheroku%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/heroku?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email

Re: patron gem install issues

2010-11-10 Thread Dan Croak
I ran into the same thing earlier today. Solved it by switching to  
RestClient.


On Nov 10, 2010, at 6:38 PM, guillaume fradin guillaumefra...@googlemail.com 
 wrote:



this error prevents me from deploying. Has any experienced this?

   Installing patron (0.4.10) with native extensions /usr/ 
ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in  
`build_extensions': ERROR: Failed to build gem native extension.  
(Gem::Installer::ExtensionBuildError)


   /usr/ruby1.8.7/bin/ruby extconf.rb
   checking for curl-config... yes
   checking for rb_thread_blocking_region()... no
   creating Makefile

   make
   gcc -I. -I. -I/usr/ruby1.8.7/lib/ruby/1.8/x86_64-linux -I.  - 
fPIC -O2 -fno-strict-aliasing   -Wall  -c session_ext.c

   session_ext.c: In function ‘Init_session_ext’:
   session_ext.c:531: error: ‘CURLPROXY_HTTP_1_0’ undeclared  
(first use in this function)
   session_ext.c:531: error: (Each undeclared identifier is  
reported only once

   session_ext.c:531: error: for each function it appears in.)
   make: *** [session_ext.o] Error 1


   Gem files will remain installed in /disk1/tmp/ 
build_16496_23515118229180/.bundle/gems/ruby/1.8/gems/patron-0.4.10  
for inspection.
   Results logged to /disk1/tmp/ 
build_16496_23515118229180/.bundle/gems/ruby/1.8/gems/patron-0.4.10/ 
ext/patron/gem_make.out
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/ 
installer.rb:446:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/ 
installer.rb:446:in `build_extensions'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/ 
installer.rb:198:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/source.rb:100:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/installer.rb:55:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/installer.rb:44:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/installer.rb:8:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/cli.rb:221:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/vendor/thor/task.rb:22:in `send'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/vendor/thor/task.rb:22:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/vendor/thor.rb:246:in `dispatch'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/ 
bundler/vendor/thor/base.rb:389:in `start'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/bin/ 
bundle:13

from /usr/ruby1.8.7/bin/bundle:19:in `load'
from /usr/ruby1.8.7/bin/bundle:19
   FAILED: http://docs.heroku.com/bundler
 ! Heroku push rejected, failed to install gems via Bundler

--
You received this message because you are subscribed to the Google  
Groups Heroku group.

To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to heroku+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/heroku?hl=en 
.


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



Re: MongoDB instrumentation in New Relic using Mongoid 2.0.0.beta.19

2010-11-03 Thread Dan Croak
In our config/newrelic.yml, we have:

  disable_mongodb: true

In config/initializers/mongo_method_tracers, we have:

Rails.configuration.after_initialize do
  Mongo::Cursor.class_eval do
add_method_tracer :refill_via_get_more,
'Database/#{collection.name}/get_more'
add_method_tracer :count,   'Database/#{collection.name}/count'
  end

  Mongo::Collection.class_eval do
add_method_tracer :find_one,'Database/#{name}/find_one'
add_method_tracer :save,'Database/#{name}/save'
add_method_tracer :insert,  'Database/#{name}/insert'
add_method_tracer :remove,  'Database/#{name}/remove'
add_method_tracer :update,  'Database/#{name}/update'
add_method_tracer :find_and_modify, 'Database/#{name}/find_and_modify'
add_method_tracer :map_reduce,  'Database/#{name}/map_reduce'
add_method_tracer :group,   'Database/#{name}/group'
add_method_tracer :distinct,'Database/#{name}/distinct'
add_method_tracer :count,   'Database/#{name}/count'
  end
end

In our Mongoid models, we have tracers on frequently used methods:

app/models/member.rb
1082:  require 'new_relic/agent/method_tracer.rb'
1084:  add_method_tracer :next_untaken_quickhit
1085:  add_method_tracer :next_unseen_result
1086:  add_method_tracer :next_quickhit_participation

On Tue, Nov 2, 2010 at 6:53 PM, fbjork fredrik.bj...@gmail.com wrote:
 Hi guys,

 is anyone using Mongoid and the New Relic addon and successfully
 seeing MongoDB transactions? I can get Resque and Redis to work, but
 MongoDB doesn't show up.

 I have the following in my Gemfile:

 gem 'rpm_contrib', '1.0.13'
 gem 'newrelic_rpm', '2.13.3'

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



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



Re: DJ Workers Crashing Without Specific Information

2010-10-04 Thread Dan Croak
There are some troubleshooting suggestions on this page:

http://docs.heroku.com/ps

On Mon, Oct 4, 2010 at 1:04 PM, Brandon Casci bran...@loudcaster.com wrote:
 I can only offer commiseration because I'm in the same position as you ;)

 Please let me know what they say.

 What do your jobs do?

 On Thu, Sep 30, 2010 at 8:58 AM, WilliamF wflana...@tempusgroup.com wrote:

 Hi all,

 I'm looking for suggestions, as I'm not getting a response from
 Heroku.

 My background DJ workers are crashing. I can't seem to make them stay
 up for more than 15 or so seconds.  If I look at the logs, the error
 message I'm getting is:


 RPM Monitoring DJ worker host:railgun64.29642 pid:29790
 *** Starting job worker host:railgun64.29642 pid:29790
 /usr/ruby1.8.7/lib/ruby/1.8/uri/common.rb:385: [BUG] Segmentation
 fault
 ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770,
 Ruby Enterprise Edition 2010.02

 NewRelic doesn't show the DJ worker in its logs that I can
 troubleshoot. NewRelic states: RPM recorded no DelayedJob background
 task executions in the last 30 minutes.

 Which, needless to say, isn't the most helpful.

 I've taken every job that I can find that is outstanding and locked in
 the database, duplicated the data down to my local machine, and run my
 machine in production mode. The workers are able to process these just
 fine on my local machine.

 Given this, and the lack of response by Heroku, I'm stuck. I'd love
 some suggestions as to the best/next way to go to troubleshoot this
 problem.  Background tasks are CORE to my application. If the
 background tasks don't work, my app is dead in the water.

 Help!

 William

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




 --
 =
 Brandon Casci
 Loudcaster
 http://loudcaster.com
 =

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


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



Re: workers dying overnight

2010-07-29 Thread Dan Croak
Only time I've had issues with workers is when I messed up something
on my side so that I was causing DJ to crash. I debugged it by doing:

heroku ps

On Thu, Jul 29, 2010 at 11:10 AM, Alex Chaffee a...@cohuman.com wrote:
 I wrote a simple Heroku app to do service monitoring. It uses
 DelayedJob to queue up repeating tasks like doing an HTTP ping of a
 server once a minute or once an hour.

 Twice now the worker has died overnight. heroku workers still says
 I'm running 1 worker, but there's no message in heroku logs -- not
 even the stub of logs from the DJ worker that was there before. It
 looks like the worker instance has been retired by the scheduler. If
 I run heroku workers 0; heroku workers 1 then it comes back and my
 jobs all start running.

 Aha! It just started up a worker on its own after I hit the web page
 for the first time today. I think the scheduler needs to be smarter
 about worker proceses... maybe it needs to check the database for any
 Delayed Jobs whose run_at is soon, and either not retire it or make
 sure a worker comes online in time to run it.

 The code is at http://github.com/alexch/sentry if you want to try it yourself.

 Has anyone else had this problem?

 --

 Alex Chaffee - a...@cohuman.com - http://alexch.github.com
 Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch |
 http://alexch.tumblr.com

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



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



new Bundler version?

2010-07-26 Thread Dan Croak
Howdy,

I was messing with a Rails 3 app on REE  Heroku. Things started out
well but as I added dependencies to my Gemfile, I started getting seg
faults:

https://rails.lighthouseapp.com/projects/8994/tickets/5193-segmentation-fault-on-rake-dbcreate-multiple-rubies-multiple-dbs

The fix in development was to use bundler --pre.

But now, when I try to deploy to Heroku, I get:

Your Gemfile.lock was generated by Bundler 0.10.
You must delete it if you wish to use Bundler 0.9.
FAILED: Have you updated to use a 0.9 Gemfile?
http://docs.heroku.com/gems#gem-bundler

It looks like Yehuda is releasing a Bundler 1.0.0 release candidate
tomorrow:

http://twitter.com/wycats/status/19558387994

Will Heroku be upgrading to that version of Bundler? I'm not sure how
to test our Rails 3 on Heroku otherwise.

Thanks!
Dan

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



Re: Build/staging environment separate from production application

2009-04-28 Thread Dan Croak
There was a recent blog post about this, along the same lines as Mat's
suggestion:
http://jqr.github.com/2009/04/25/deploying-multiple-environments-on-heroku.html

On Tue, Apr 28, 2009 at 2:30 PM, Mat Schaffer mat.schaf...@gmail.comwrote:


 On Apr 28, 2009, at 1:50 PM, teejayvanslyke wrote:
  Is anyone else using Heroku for two environments running different
  branches of the same repository on each?  What is your solution?

 I'm not doing this, but from my knowledge of git it should be totally
 doable. You'd have two heroku apps, for the sake of discussion call
 them myprodapp and mystagingapp.

 You'd add both of these as remotes to your git repo:
 git remote add prod g...@heroku.com:myprodapp.git
 git remote add staging g...@heroku.com:mystagingapp.git

 Then when you want to push to prod from master do:
 git checkout master
 git push prod master

 When you want to push to staging do:
 git checkout edge
 git push staging master

 Git push can also take a source branch so the checkout isn't even
 necessary really. You should be able to do:
 git push g...@heroku.com:myprodapp.git master:master
 git push g...@heroku.com:mystagingapp.git edge:master

 I could be a little off, but that's the basic idea. Check out 'git
 push --help' for more details. Also http://grb.rubyforge.org is
 helpful for dealing with remote branches.

 -Mat

 



-- 
Dan Croak
http://thoughtbot.com

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



Re: Trouble with hoptoad

2009-04-16 Thread Dan Croak
This should have been fixed in this commit:
http://github.com/thoughtbot/hoptoad_notifier/commit/da5bc5a09f0d887e114e2d3aa86268330e05e513

Thanks,
Dan

On Mon, Apr 13, 2009 at 3:47 AM, Ryan Tomayko r...@heroku.com wrote:


 On Sun, Apr 12, 2009 at 8:44 PM, shenry stuarthe...@gmail.com wrote:
 
  I have this same problem, Hoptoad will correctly send a message after
  heroku rake hoptoad:test but if I create an exception manually I get
  nothing
 
  Hoptoad Success: Net::HTTPOK
  Rendering /disk1/home/slugs/2185_8e050c1_3bb1/mnt/public/500.html (500
  Internal Server Error)
 
  Any ideas?

 There's an open bug in the hoptoad plugin. Full detail below but the
 quick workaround is to add async. to the environment_filters in
 config/initializers/hoptoad.rb as follows:

HoptoadNotifier.configure do |config|
  config.api_key = 'YOUR KEY'
  config.environment_filters  'async.'
end

 This causes the notifier to remove any matching keys before building
 the YAML payload to send to hoptoad.

 Here's my original write up on the issue. I'm under the impression
 that the thoughtbot folks are aware of this. Maybe someone on the list
 can bring it to the right person's attention:

 This issue occurs when there are complex objects in the request
 environment. The hoptoad plugin builds a POST body to send to the
 hoptoad server by converting the session, environment, request,
 backtrace, and error_message into YAML. Heroku loads a special version
 of Thin that places two special variables in the environment:
 async.callback and async.close. These are both Proc/Method objects
 but could theoretically be any object not directly serializeable to
 YAML. When these objects are converted to YAML, they look like this:
 async.callback: !ruby/object:Method {}

 I assume some kind of deserialization exception is occurring on the
 hoptoad server when an attempt is made to parse the YAML. The right
 fix is probably to adjust the following code in the hoptoad plugin:

 def clean_non_serializable_data(notice) #:nodoc:
  notice.select{|k,v| serializable?(v) }.inject({}) do |h, pair|
h[pair.first] = pair.last.is_a?(Hash) ?
 clean_non_serializable_data(pair.last) : pair.last
h
  end
 end

 def serializable?(value) #:nodoc:
  !(value.is_a?(Module) || value.kind_of?(IO))
 end

 The serializable? check should probably be a whitelist of allowed
 value types instead of a blacklist of disallowed value types. Adding
 Method/Proc to the current list of disallowed types would also solve
 this issue but it will happen again with some other object. It's
 becoming a very common pattern in Rack to add various types of objects
 to the environment.

 Thanks,
 Ryan

 



-- 
Dan Croak
http://thoughtbot.com

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