On Tuesday, 28 February 2012 at 20:21, Patrick Stinson wrote:
> I'm no gem expert, but I have two little problems with managing different
> sets of gems.
>
> First, I want to use pdfkit in my rails project which requires wkhtmltopdf.
> wkhtmltopdf comes in two binary versions, one for my mac (wkhtmltopdf-binary)
> and one for amd64 (wkhtmltopdf-heroku) that works on heroku. How do I use one
> on my local system and the other on heroku? The pdfkit gem will use whichever
> one I have told bundler to install (I think), so when I try to trick it by
> installing the wkhtmltopdf-heroku gem and wkhtmltopdf binary locally it looks
> for the amd64 version instead of the local version, which obviously doesn't
> work on my mac I use for development.
I've done this recently and used the following approach:
In my Gemfile I had (as a global gem):
gem 'wicked_pdf'
then in an initializer I have:
WICKED_PDF = { :wkhtmltopdf => (Rails.env.test? || Rails.env.development? ?
'/usr/local/bin/wkhtmltopdf' : Rails.root.join('bin',
'wkhtmltopdf-amd64').to_s), :exe_path => (Rails.env.test? ||
Rails.env.development? ? '/usr/local/bin/ ' : Rails.root.join('bin',
'wkhtmltopdf-amd64').to_s) }
So, wkhtmltopdf-amd64' is committed into a local bin folder and used by
wicked_pdf as the binary in anything other than development, where it uses the
local path of the installed binary.
Hopefully this makes sense.
-Neil
>
> Second, I fixed a bug in the pdfkit gem. How, then, do I use my patched
> version instead of having heroku automatically install the current version
> from the gem's original vendor?
>
> Thanks!
>
> --
> 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/-/mRxTkY2NHH8J.
> To post to this group, send email to [email protected]
> (mailto:[email protected]).
> To unsubscribe from this group, send email to
> [email protected]
> (mailto:[email protected]).
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en.