Learning About SSL the Hard Way: Recent RVM Installation Error

Does this error look familiar? If you happen to be reinstalling RVM onto a new computer or virtual machine, this error might have popped up. So what gives? My co-workers, @jonzeper and @ctruelson, figured this one out.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[2013-03-15T15:42:22+00:00] INFO: Processing rvm_default_ruby[ruby-1.9.3] action create (rvm::system line 183)

================================================================================
Error executing action `create` on resource 'rvm_default_ruby[ruby-1.9.3]'
================================================================================

NoMethodError
-------------
private method `chomp' called for nil:NilClass

Cookbook Trace:
---------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rvm/libraries/chef_rvm_string_cache.rb:77:in `canonical_ruby_string'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rvm/libraries/chef_rvm_string_cache.rb:50:in `fetch'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rvm/libraries/chef_rvm_string_helpers.rb:55:in `normalize_ruby_string'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rvm/providers/default_ruby.rb:26:in `load_current_resource'

Resource Declaration:

---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rvm/libraries/chef_rvm_recipe_helpers.rb

182:         # set a default ruby
183:         rvm_default_ruby opts[:default_ruby] do
184:           user  opts[:user]
185:         end
186:

Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rvm/libraries/chef_rvm_recipe_helpers.rb:183:in `install_rubies'

rvm_default_ruby("ruby-1.9.3") do
  retry_delay 2
  retries 0
  recipe_name "system"
  ruby_string "ruby-1.9.3"
  action :create
  cookbook_name :rvm
end

[2013-03-15T15:42:22+00:00] ERROR: Running exception handlers
[2013-03-15T15:42:22+00:00] ERROR: Exception handlers complete
[2013-03-15T15:42:22+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-03-15T15:42:22+00:00] FATAL: NoMethodError: rvm_default_ruby[ruby-1.9.3] (rvm::system line 183) had an error: NoMethodError: private method `chomp' called for nil:NilClass

Your computer connects to https://rvm.io. As of 3/15/13 at 1:20pm, the site has an expired SSL certificate! You can proceed anyways, but this error prevents your computer from automatically downloading and installing. No worries! There is a fix until @wayneeseguin updates their SSL certificate.

If you’re using vagrant, edit your cookbooks/rvm/attributes/default.rb file. There should be some lines that look like this:

1
2
3
4
5
# system-wide installer options
default['rvm']['installer_url'] = "https://get.rvm.io"
default['rvm']['branch']  = "stable"
default['rvm']['version'] = "head"
default['rvm']['upgrade'] = "none"

Change it to this:

1
2
3
4
5
# system-wide installer options
default['rvm']['installer_url'] = "http://get.rvm.io"
default['rvm']['branch']  = "stable"
default['rvm']['version'] = "head"
default['rvm']['upgrade'] = "none"

Ok, but what does SSL even mean? Why do we need SSL certificates? I recently ran into this issue because the native Android web browser didn’t like our SSL certificate. So this is not just an RVM problem. Here’s an oldie, but goodie from youtube explaining it in detail.

Comments