Follow me as I struggle with rogue technology, insane programmers, and impossible math questions in a battle to the death.

Wednesday, January 09, 2008

Ruby on Rails + Ubuntu = Hostility

I was considering trying Ruby on Rails for a project I'm working on and decided to try and install it on Ubuntu.

jfenwick@mars:~$ sudo gem install rails --include-dependencies
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find rails (> 0) in any repository


I did some searching on the internet and found that the gem server randomly can't find gems, but if you try again later it works. Eventually I did get the rails gem and its dependencies installed, but now the second major problem. I attempted to create an application skeleton and got:

jfenwick@mars:~/projects$ rails foo
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
bash: rails: command not found


Did some more searching, found that if you install gems using apt-get there are permissions problems. So I removed gems, go back to the rails site, download gems, try to install it and get:

jfenwick@mars:~/Desktop/rubygems-1.0.1$ ruby setup.rb
mkdir -p /usr/local/lib/site_ruby/1.8/rbconfig
/usr/lib/ruby/1.8/fileutils.rb:243:in `mkdir': Permission denied - /usr/local/lib/site_ruby/1.8/rbconfig (Errno::EACCES)
from /usr/lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
from /usr/lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
from /usr/lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
from /usr/lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
from /usr/lib/ruby/1.8/fileutils.rb:201:in `each'
from /usr/lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
from /usr/lib/ruby/1.8/fileutils.rb:1527:in `mkdir_p'
from setup.rb:88
from setup.rb:85:in `each'
from setup.rb:85
from setup.rb:82:in `chdir'
from setup.rb:82


Weak.

I found this site, it helped a lot: urbanpuddle

When I tried to install Mongrel I got this error:


jfenwick@mars:~/projects/foo$ sudo gem install mongrel
Building native extensions. This could take a while...
ERROR: Error installing mongrel:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install mongrel
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.1/ext/fastthread/gem_make.out


This was my fault as I hadn't installed the ruby1.8-dev package. However, I still think the process of finding which packages you need to install through apt-get, and which ones you have to install through gems is maddening.

During my searching I came across a person who had my problem with Mongrel, and someone asked if they were "on Debian or something equally hostile to Ruby". I feel that's a fair judgment, getting Rails to work on Ubuntu has been pretty laborious.

Labels: , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home