rvm single user installation fails with: curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You want to install rvm as a single user in a new linux but when trying to install it with the normal installation instruction:

it fails with the following error:

Solution

You are behind a proxy server and you need to setup your environment variables for the server in your .profile file like the following (and make sure you source the file afterwards with . ~/.profile):

rvm – Branch origin/ruby_2_1_0 not found.

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You are trying to install the new ruby in your ubuntu rvm installation with rvm install 2.1 but you are getting the error:

Solution

If you are careful and you notice a warning message as:

then you would need to update your rvm installation to the latest one with:

And then you should be able to install the latest ruby version with:

Dreamhost keeps asking for password when installing rvm ruby version

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

After installing rvm on dreamhost, when trying to install any ruby version afterwards, there is a prompt for password, and when entering the user’s password there is the message that the user is not in the sudoers list.

Solution

To be able to install the rvm ruby version you would like you should be installing them by using the following which is based on the answer here :

and then:

rvm “You need to change your terminal emulator preferences to allow login shell.”

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

After a new rvm installation in an (k)ubuntu system you get the following error from rvm when trying to switch between rubies:

Solution

As the message suggests you can change the setting in your terminal which is fine if you are using the gnome-terminal by going to the link provided:

but if you are using Konsole in KDE you need to go to a different link that explains the change in the settings:

rails `require’: cannot load such file — mysql2/mysql2 (LoadError)

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You want to use a different ruby version from the one you have initially installed and build your application with, but when you change it in your rvm installation you get the following error:

Solution

To make it work again you will have to uninstall the mysql2 gem and install it again in the new ruby version with the option –platform=ruby.

RVM and RubyGems versions

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You would like to upgrade your rubygems version from 1.8.17 to the latest version 2.0.7 for example.

Solution

You can upgrade to a specific or the latest gem version and relate that to a specific rvm ruby that you have installed.
So if for example you have ruby-1.9.3-p327 and ruby-2.0.0-p247, you can have different gem version (or the same if you want) for each ruby version.

To upgrade to the latest one in the ruby-2.0.0-p247 for example you could do the following:

Getting rails console on an amazon aws server when using rvm

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You would like to get access to your rails application console on an Amazon ec2 instance, and you are also using rvm.

Solution

  • Login with ssh to your server as normal:
  • Go to your application’s current folder:
  • Run the following replacing the environment with your specific environment (ie production,beta,staging etc):

sudo: puppet: command not found – when trying to use puppet with rvm in aws

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

When trying to use the

command in a aws instance to follow the instruction from ‘Deploying Rails’, the following error complains that the puppet command is not found, like:

After some searching and having a look at the blog post here and using the rvm notes in the aws instance and looking at this:

It seems that for security reason the sudo command resets the path in the system.

You can actually see that this the case by running the command to display the path of the normal user:

and the corresponding one for the sudo:

So a workaround to make it work is to add your group into the exemptions group in the visudo file, which means editing the visudo file:

and adding the group that your user you are working with belongs to:

Writing a Passenger Module for Puppet – Vagrant

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Following the steps described in the “Deploying Rails Applications” book and using the currently latest puppet installation described here, the actual puppet files had to be modified slightly in order to make it work as expected.

The main issues requiring the changes were as follow:

  • System wide rvm installation – different paths, and the use of the rvmsudo command instead of sudo
  • Use of latest puppet gem (3.0.1) – ruby 1.9.3 is supported
  • Use of Debian/Ubuntu system – different way of configuring passenger with apache2

So the full file for the passenger module (puppet/modules/passenger/manifests/init.pp) is:

Going through the file one of the first things to notice is the declaration about the “apache2-prefork-dev” package installation

The reason for this package, is that when trying to compile the passenger apache module (passenger-install-apache2-module), the script will complain that the following packages are missing:

By installing the first of the packages (apache2-prefork-dev) the other two are installed automatically as dependencies.

NOTE In trying to install it in an Ubuntu AMI image in AWS EC2 there is also an additional package requirement because the installer complains about:

So there is the additional package added as:

Further down there are two file resources named “passenger_conf” and “passenger_load”.
Looking at the structure in debian for the apache2 configuration it seems that apache2 in debian needs two different files for each module that can be loaded one with named as module.conf and another as module.load to be placed into /etc/apache2/mods-available.

So we can create these two files and placed them in the files folder, as:

puppet/modules/passenger/files/passenger.conf

and, puppet/modules/passenger/files/passenger.load

Which you can actually see if you compile manually the passenger apache2 module as they are described in the output on successful compilation:

Finally the last section of the init.pp file enables the passenger module with the a2enmod apache command:

A couple of useful apache2 commands when testing are:

  • To test what modules are availble for loading: If run after creating the two passenger files passenger.conf and passenger.load, then the passenger module should appear in the list
  • To see the currently enabled modules: Which again if it is run after the passenger modules has been enabled with a2enmod passenger then it should show an entry with