Openly certifying your Rubies

Posted by s.f. on June 14, 2011

If you’re using the MacPorts version of OpenSSL, and have a Ruby installed either by MacPorts or RVM, you’ve probably clashed with the dreaded “SSLv3 read server certificate B: certificate verify failed” message
(Or you’ve forced the verification check off, which is not a good idea )

Quick fix:

port install curl curl-ca-bundle

ln -s /opt/local/share/curl/curl-ca-bundle.crt /opt/local/etc/openssl/cert.pem

(using sudo as needed)

Continue reading…

No, We Really Mean “Vendor It”

Posted by s.f. on June 13, 2011

(Originally posted on tumblr)

Now that we have both RVM and Bundler, you’re following the advice in this article and keeping all your gems in source control, right?

No? Why not? “I have a custom fork that I don’t want to put on a public server”? Pfshaw!

1. Put a ‘:git’ option in your Gemfile pointing to your local repo:

gem ‘my_custom_gem’, ’1.0.0′, :git=>’file://path/to/your/repo’

2. Follow the steps in the article:

bundle install –path vendor’

bundler package

Make sure the gem file for your custom gem is in vendor/cache.

3. Remove the :git flag in your Gemfile

gem ‘my_custom_gem’, ’1.0.0′

4. Run

bundle install –path vendor

again to remove the git references from Gemfile.lock.

5. Check in vendor/cache/*, Gemfile, Gemfile.lock, and .bundle/config to source control.

There now, that wasn’t so hard. And now you don’t have to worry about losing the original git repo, or reinstalling the custom gem on every deploy.