3
votes

I am trying to install this gem: https://github.com/mongodb/mongo-ruby-driver (on the master branch).

When I run bundle install I get:

Enter PEM pass phrase:

(to which I don't have a key as this is a public repo, so I press enter)

OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key: nested asn1 error

I tried downloading the zip and bundling from source and get the exact same problem.


Update My Local Environment Variables

rvm_bin_path=/Users/Clay/.rvm/bin

TERM_PROGRAM=Apple_Terminal

GEM_HOME=/Users/Clay/.rvm/gems/ruby-2.0.0-p451

TERM=xterm-256color

SHELL=/bin/bash

IRBRC=/Users/Clay/.rvm/rubies/ruby-2.0.0-p451/.irbrc

TMPDIR=/var/folders/yl/7nzdd2wx2tzbrwr4bm8t25qr0000gn/T/

Apple_PubSub_Socket_Render=/tmp/launch-8mCJ2I/Render

TERM_PROGRAM_VERSION=326

OLDPWD=/Users/Clay/Developer

MY_RUBY_HOME=/Users/Clay/.rvm/rubies/ruby-2.0.0-p451

TERM_SESSION_ID=63791880-F18D-4CD5-932D-109041B81415

USER=Clay

_system_type=Darwin

rvm_path=/Users/Clay/.rvm

SSH_AUTH_SOCK=/tmp/launch-8O5pHu/Listeners

__CF_USER_TEXT_ENCODING=0x1F5:0:0

rvm_prefix=/Users/Clay

__CHECKFIX1436934=1

PATH=/Users/Clay/.rvm/gems/ruby-2.0.0-p451/bin:/Users/Clay/.rvm/gems/ruby-2.0.0-p451@global/bin:/Users/Clay/.rvm/rubies/ruby-2.0.0-p451/bin:/Users/Clay/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/local/mysql/bin:/Users/Clay/Developer/mongodb-osx-x86_64-2.4.6/bin:/usr/local/mysql/support-files/:/Applications/Sublime Text.app/Contents/SharedSupport/bin/:/Users/Clay/Developer/AWS-ElasticBeanstalk-CLI-2.6.3/eb/macosx/python2.7/

PWD=/Users/Clay/Developer/mongo-ruby-driver

LANG=en_US.UTF-8

_system_arch=x86_64

_system_version=10.9

rvm_version=1.24.7 (stable)

HOME=/Users/Clay

SHLVL=1

RAILS_ENV=development

LOGNAME=Clay

GEM_PATH=/Users/Clay/.rvm/gems/ruby-2.0.0-p451:/Users/Clay/.rvm/gems/ruby-2.0.0-p451@global

DISPLAY=/tmp/launch-Pm5rac/org.macosforge.xquartz:0

RUBY_VERSION=ruby-2.0.0-p451

SECURITYSESSIONID=186f1

_system_name=OSX

_=/usr/bin/env

1

1 Answers

1
votes

I suggest you first get it working using the stable version and without using bundle. If that works, then try the master branch and bundle.

First, try this and tell us if it succeeds:

gem install mongo

(If it fails then please copy/paste the exact results as an edit to your question.)

Second, try building the current stable version in a fresh directory:

rm -rf mongo-ruby-driver
git clone https://github.com/mongodb/mongo-ruby-driver.git
cd mongo-ruby-driver
git checkout 1.11.1
gem build mongo.gemspec

(If it fails then please copy/paste the exact results as an edit to your question.)

What you expect to see is:

Warning: No private key present, creating unsigned gem.
Successfully built RubyGem
Name: mongo
Version: 1.11.1
File: mongo-1.11.1.gem

(If you see anything different then please copy/paste the exact results as an edit to your question.)

If you still getting the PEM error when you try to build 1.11.1, then try editing mongo.gemspec. Comment out these lines that may be causing the PEM prompt:

# s.signing_key     = 'gem-private_key.pem'
# s.cert_chain      = ['gem-public_cert.pem']

Then retry the build:

gem build mongo.gemspec

(If the build fails, then I suggest looking at your gem environment to see if it's all as you expect. Run gem env and copy/paste the results into your question. Also, search your various gem env directories for a file called gem-private_key.pem. This file may be causing your issue; temporarily rename it and try again.)

If the build succeeds, then install as usual:

gem install mongo-1.11.1

If that all works, then you're in good shape.

If you're positive that you want the master branch:

git checkout master
gem build mongo.gemspec