Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got some problem installing rails on Ubuntu 12.04. I have rails working on my Ubuntu for a little time. But for some reason I uninstall rails. When I decided to install it again with sudo gem install rails . The command rails -v doesn't work. When I run the command sudo gem install rails there is no error occurring just a message that saying:

Successfully installed rails-3.2.6

I look at the folder /usr/lib/ruby/gems/1.8/gems/rails-3.2.6 and it is completely empty?

I wonder how I can fix this problem?

share|improve this question
See my answer below, I would have put it in a comment, but a bit too much text. It's what I use on new OpenVZ Container VMs in my Private Cloud for hosting Ruby on Rails servers. – kobaltz Jul 10 '12 at 15:08
Maybe try uninstalling it, then running a cleanup, deleting that folder, and trying again? – slhck Jul 10 '12 at 15:08

below is my openvz container script for Ubuntu Server 12.04. It should work with desktop version as well. It downloads and installs a bunch of updates and dependencies. A lot of it can be stripped out if you are not using this as a production environment, but it seems to work well for me even in a devel environment.

It will install the latest Ruby, Gems, Ruby on Rails, Passenger

sudo su

apt-get update && apt-get upgrade -y && apt-get install libopenssl-ruby build-essential nano libmagic-dev coffeescript zlib1g-dev libyaml-dev libssl-dev libmysqlclient-dev ntp ntpdate apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libcurl4-openssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev libmagick-dev git-core git-gui git-doc libreadline-dev -y && a2enmod suexec rewrite ssl actions include && a2enmod dav_fs dav auth_digest && /etc/init.d/apache2 restart && wget && tar zxf ruby-1.9.3-p194.tar.gz && cd ruby-1.9.3-p194 && ./configure && make && make install && gem update --system && gem install rails && gem install passenger && passenger-install-apache2-module

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.