Ruby/RubyGems/Rails/MySQL installation h e double-hockey sticks

Posted by Tony on June 29th, 2007 in Open Source

So I decided to go my own way since I don't really like installing via a package manager. IMO, package managers are good for installing shared libraries and the like on Linux, but major apps like Subversion and PostgreSQL and stuff like that I like to install where I want them so I can maintain them easier and have them all in one place. So I understand that I made things harder for myself from the get go since I didn't want to use the "opinionated" way of doing things, and still I think it's worthwhile saying that I find it ironic that the technology intended to make one's web development life so easy and fun is not easy and fun to install on Linux. This is the common statement I found on the web and in books about how to install Ruby and Rails and MySQL: "On Windows, Instant Rails provides a self-contained Rails environment… On the Mac, Locomotive is a self-contained Rails environment… If you are running Linux, you know how to suck bits off the Web. Start with the Rails Wiki, and find instructions for your flavor of Linux." Not a good sign. It took me forever to find releases of the projects out on the web since I was looking for binaries and they just don't exist. This *really* bothered me. I love Linux for doing work, but the compile-from-source thing just drives me bananas. There are always problems and it takes forever to compile and make and make install and understand all the options on each of the commands and finally after 3 days of research you can finally get the stupid project installed. So I had to compile Ruby from source. Then I had to go find RubyGems and compile it from source. At this point I was ready to pick up my computer and throw it off the 4th story of the building where I work. So I succumbed to the "opinionated" recommendation to use RubyGems to install Rails. That worked thankfully. And now all I had to do was install MySQL. So off I went to find the source since I quickly discovered that MySQL doesn't like to make the source easily accessible anymore so I had to really search around for it. Finally, I found it at: ftp://ftp/mysql.com/pub/mysql/src/. Once again, back into the weeds trying to get MySQL to compile and install. So here are the steps I did to get this stuff installed – which took me approximately 4-5 hours. 1. Ran the adept package manager to install libraries such as irb, rdoc, etc. In a shell: 2. Found and untarred the Ruby 1.8.5 source distro. (http://rubyforge.org/frs/?group_id=426) 3. Renamed the directory to ruby-setup and created a new ruby-1.8.5 directory. 4. Cd into the ruby-setup dir. 5. Ran ./configure –prefix /path/to/ruby-1.8.5 dir. ran make and make install. 6. Added RUBY_HOME to my path. 7. Found and untarred the RubyGems 0.9.4 source distro. 8. Renamed the directory to rubygems-setup. 9. Cd into the rubygems-setup dir. 10. Ran sudo /path/to/rubybin/ruby setup.rb. (I just discovered there is a better way to do this. http://rubygems.org/read/chapter/3) 11. Ran sudo /path/to/rubybin/gem install rails –include-dependencies. 12. Added RUBYOPT=rubygems to my profile. (This is necessary to have ruby run apps with rubygems loaded automagically) 13. Found and untarred the MySQL 5.0.42 source distro. (ftp://ftp/mysql.com/pub/mysql/src/) 14. Renamed the directory to mysql-setup and created a new mysql-5.0.42 directory. 15. Cd into the mysql-setup dir. There is a very helpful file called INSTALL-SOURCE that outlines all the necessary steps – including a nice section on the configure options. 16. Did all the MySQL steps – about 10 in all. Finally everything was installed – this took me the entire morning. After coming back from lunch, I actually started a sample app using the book Rails for Java Developers. Amazingly, there was a mistake in the instructions and when I got to the part about running the stubbed out tests, I got a bunch of failures which the book did not mention. If you get some errors running rake the first time after creating an app in Rails, check that the .yml file has the correct named variables for the test to use. The test referred to :first, but the .yml file had one: as the variable. Sort of close, but not close enough. So could someone please package a self-contained Ruby on Rails environment of binaries for Linux like the Mac and Windows versions? I would buy you a case of barleypop. '8~)

Bookmark: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • Reddit
[Trackback URI]

Comments

Subscribe to comments with RSS

  1. Daniel Lopez said, on August 14th, 2007 at 11:12 am

    Check out Ruby stack

    Contact us for details of barleypop delivery ;)