Failure building with `rake gem:windows`

Issue #246 resolved
Andrew Harper created an issue

Hi, I'm trying to build pg via rake gem:windows. It is almost successful (docker, etc working fine). However it fails near the end with

Errno::ENOENT: No such file or directory @ rb_sysopen - ~/.gem/gem-private_key.pem

There is also a long stack trace but it's standard library stuff. The previous few successful log lines before the error are:

** Invoke spec/pg/type_map_by_mri_type_spec.rb (not_needed)
** Invoke spec/pg/type_map_by_oid_spec.rb (not_needed)
** Invoke spec/pg/type_map_in_ruby_spec.rb (not_needed)
** Invoke spec/pg/type_map_spec.rb (not_needed)
** Invoke spec/pg/type_spec.rb (not_needed)
** Invoke spec/pg_spec.rb (not_needed)
** Execute pkg/pg-0.18.4.gem
cd pkg/pg-0.18.4
rake aborted!

I see that there's code specifically for this in Rakefile.cross to copy pem files from .gem, but there's no .gem folder in the repo. Also, there IS a certs repo with a pem inside, but it's not being copied by the rake file. However, modifying Rakefile.cross to include that pem arrives at the same error.

What is this file? Is it supposed to be in the repo? Is it possible to build pg without it? If so, how?

Thanks

Comments (3)

  1. Lars Kanis

    @aharpervc You can either:

    • remove the related (mkdir and cp) lines from the Rakefile.cross

    or

    • generate your own key for signing:
    $ gem cert --build me@example.com
    Public Cert: gem-public_cert.pem
    Private Key: gem-private_key.pem
    $ mv gem-private_key.pem ~/.gem/
    

    We usually sign the built gems, so that there's no conditional copy so far.

    As alternatives you could:

    • build pg native on windows (against installed PostgreSQL version)
    • use the latest pre-release from rubygems.org
  2. Log in to comment