Installing and running Ruby-rack on OpenSolaris
By drapeau on Nov 06, 2009
Anyway, been doing some testing of the package that Amanda submitted. Here's what I did and what I observed:
First, I made sure I had access to the OpenSolaris Source Juicer "pending" repository. As I've noted before, two steps:
- type "pfexec pkg set-publisher -O http://jucr.opensolaris.org/pending jucr-pending"
- type "pfexec pkg refresh"
So I did this and downloaded the package. The package notes that it depends on the Ruby package. The Package Manager pulled it in just fine. How do I know? Before installation, I could not type "ruby" and get anything back. Afterward, it worked.
$ cd /usr/ruby/1.8/lib/ruby/gems/1.8/gems/rack-1.0.1/example
$ rackup lobster.ru
This starts a web server on port 9292 with a little "lobster" program. I launch the web browser and go to "http://localhost:9292" and I saw a simple web app that shows a crude "picture" of a lobster, and two things I can do: flip the lobster from right to left and back again, and show a crash dump of the Ruby Rack program. I tried both of those things; they worked just fine.
After this, I killed the "rackup" program then tried it again with the other ".ru" file in that same directory, "protectedlobster.ru". That gives an added feature of authenticating into the web app (password is "secret"; as far as I can tell, use any username you wish). That worked, too: if I didn't provide the right password, nothing happened. If I provided the right password, it worked fine.
So that all worked just fine. The next set of tests was more in-depth, running a partial test suite. For this set of steps, I had to install both the "SUNWgcc" and "SUNWgmake" packages, again with the Package Manager. I did these steps:
- su - (i.e., pretend you're root; without doing this, step 3 below complained that it couldn't write to /var/ruby/1.8/gem_home/bin)
- Add /var/ruby/1.8/gem_home/bin to your $PATH
- type CXX=/usr/sfw/bin/g++ gem install memcache-client ruby-openid camping mongrel thin test-spec --no-ri --no-rdoc
- type "gem install rake"
- type "rake test".
That sounds like good news to me!
So folks: the Ruby Rack web framework is available via OpenSolaris. Check it out and see if it works for you, Ruby developers. Let us know how it goes, will ya?
Powered by ScribeFire.