multiple user installation of rvm in Debian

Problem
You would like to install rvm as a multiple user installation in Debian.

Solution
You would need to do the following:

as root

  • bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

for each individual user you want to use rvm

  • in the user’s .bashrc or .bashrc_profile add the following at the bottom:
    [[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" # This loads RVM into a shell session.
  • reload the .bashrc or .bashrc_profile by:
    source .bashrc|.bashrc_profile

and you should be able to do rvm -v.

ImageMagick, RMagick, Debian installation

Problem
You want to use the rmagick gem in your ruby on rails project, but you need to install the imagemagick first.

Solution
If Imagemagick is not already installed, use the following to install it:
$ sudo apt-get install imagemagick$ sudo apt get install libmagick-dev libmagickwand-dev

You should then be able to install and use the rmagick gem

Gitweb access to gitolite repository

Problem
You are trying to set up gitolite access through gitweb but the gitweb page, shows ‘no projects avaiable’ even though you have repositories available.

Solution
Try to follow the guide here.
Some of tthe most important steps for having the right access permissions are:

  • Add the www-data user in the gitolite group by:
    $ sudo usermod -a -G gitolite www-data
  • Add the paths to the repositories and the projects list:
    $ sudo vi /etc/gitweb.conf
    $projectroot ="/var/lib/gitolite/repositories";
    $projects_list="/var/lib/gitolite/projects.list";
  • Change the permissions in the repositories:
    $ sudo chmod g+r /var/lib/gitolite/projects.list
    $ sudo chmod -R g+rx /var/lib/gitolite/repositories
  • Change permissions in the /var/lib/gitolite/.gitolite.rc file to allow access to the repositories:
    $REPO_UMASK = 0027;
  • Finally change the git-daemon to run with the gitolite group permissions in the file /etc/sv/git-daemon/run:
    exec chpst -ugitdaemon:gitolite

no such file to load — readline (LoadError) – Rails 3.0.3 console – rvm

Problem

When you try to run the console rails c in a new Rails 3.0.3 application, and when you use rvm, you get the following error:

no such file to load -- readline (LoadError)

Solution

It’s quite like likely that the readline libraries are missing from your installation. To find out which ones go to the directory that the error is indicating (ie):

cd ~/.rvm/rubies/ruby-1.8.7-p299

and then to the following:

cd ext/readline

then run the following:

ruby extconf.rb

If you get something like:
checking for readline/readline.h... no
checking for editline/readline.h... no

then you are probably missing the neccessary header files for readline.
so install them in your system (ie in Mandriva):

sudo urpmi readline-dev,

In Debian you will need to install libreadline5-dev and maybe libncurses5-dev (apt-get install).

When the package is installed successfully run the following again:

ruby extconf.rb
make
sudo make install

You should now be able to go back to your project and run rails c with no errors.