Archive for September 2008


“windows” man walking

September 24th, 2008 — 7:46pm

“windows” man walking. “windows” man walking here.

So you found Merb. You’re on a Windows desktop. Something feels wrong, but you know you can do this Merb stuff if you could only get it installed. You’ve gone to the Merb wiki and now you’re a little confused. Merb is almost 1.0 but not quite and you want to be on the “edge”. Cygwin sounds funny to you and you think it’s “that terminal thing”. All the kids are doing Rails, but this Merb thing sounds “cooler”.

Does this sound like you? No? I keed, I keed.

Get the environment

Click here and download the setup.exe and run it.

Now when you get to the “Select Packages” screen we need to grab a few of the necessary packages to facilitate a Merb environment. From the “Select Packages” screen click on the “View” button until it shows “Full”.

From the list select all of the following packages:

  • curl
  • gcc
  • gcc-core
  • gcc-g++
  • git
  • libiconv
  • libiconv2
  • libxml
  • libxml2
  • libxml2-devl
  • make
  • ruby

Click next and watch the downloads. When it’s done it will ask to put a shortcut on the desktop and in the start menu. Open Cygwin and you’ll be greeted by a message about group names and domain users. Ignore this or run the example commands - your choice. The command line will be below this and will look like this:

you@yourmachine ~
$

This is showing the terminal is launched and starting in your home directory (~). If you don’t know what to do with a Terminal - this post will be OK for you but your not going to learn everything here. You should know how to navigate directories and tar. Good? Good.

I have a Terminal - now what?

Let’s start by checking we have Ruby. From the command line run:

$ ruby -v

You should see:

ruby 1.8.7 (2008-06-20 patchlevel 22) [i386-cygwin]

1.8.7 or 1.8.6 are acceptable version numbers. Now lets get RubyGems installed. Download this and then from inside Cygwin navigate to the directory you saved that file. (Like I said - if you don’t know how to do this go elsewhere to find out how to cd your way around):

$ cd /cygdrive/c/Documents\ and\ Settings/you/My\ Documents/
$ tar xzvf rubygems-1.2.0.tgz

You should see the RubyGems directory extract out from the tar file. Now run the setup for RubyGems:

$ cd rubygems-1.2.0
$ ruby setup.rb
$ cd ..

It should end with a nice little message from the RubyGems team.

Can I Merb yet?

Almost. We actually need to get Merb first. The rest of this post will politely be stolen from this post. There are a few hiccups along the way due to Cygwin and Windows that I will address.

First let’s grab dependencies:

$ gem install erubis rake json json_pure rspec rack hpricot mime-types ruby2ruby\
 ParseTree memcache-client templater haml mailfactory sequel mongrel libxml-ruby\
 english addressable builder

This will crash out right after ruby2ruby-1.1.9 is successfully installed. You will see:

ERROR: While executing gem ... (Errno::EACCES)
     Permission denied - /usr/lib/ruby/gems/1.8/gems/ParseTree-2.2.0/History.txt

I don’t know why this is exactly. But I know how to work around it. Do the following:

$ gem uninstall ruby2ruby
$ gem uninstall ParseTree
$ gem install ruby2ruby

Type “Y” to remove the executables and during the install you will see ParseTree comes with ruby2ruby as a dependency. Now finish the rest of the list above:

$ gem install memcache-client templater haml mailfactory sequel mongrel libxml-ruby\
 english addressable builder

Once the dependencies are taken care now we can go grab Merb itself.

Thor

Thor is helpful because it provides a nice way to use Rake tasks to grab the git repos of Merb and install the edge versions. Let’s get it:

$ git clone git://github.com/wycats/thor.git
cd thor
rake install

NOTE: As of Sept. 24 2008 this git version does not work. The rake task doesn’t work. Do this:

$ gem install thor

Possibly within the next few days the git repo will be updated. It looks as though it is utilizing Thor within the Rake task. Real dogfooding.

Now that we have Thor let’s use it to grab the Merb tasks:

$ thor install http://merbivore.com/merb.thor

This will prompt for a name - call it “merb”.

Merb

Now is the good stuff. First we need to move to a directory that is free of spaces in the name. So do this:

$ cd /cygdrive/c
$ mkdir merb_source
$ cd merb_source

Once you have this setup now do this:

$ thor merb:edge:core --install
$ thor merb:edge:more --install
$ thor merb:edge:plugins --install

This will roll through the process of grabbing the source, creating the gem packages and install all of them. You will have Merb - but don’t you want DataMapper too?

DataMapper

DataMapper does what ActiveRecord does, but in a much different way. It has some nice features that any ActiveRecord fan should look into. Here is how to grab it:

$ thor merb:edge:dm_core --install
$ thor merb:edge:dm_more --install

But there is a small snag in this. A pretty important gem gets skipped. The easy way around this is to do it ourselves:

$ cd src/dm-more/pkg
$ gem install merb_datamapper --local

Installed!

As you can see there are a few steps but they are pretty easy. And if you didn’t catch the reference above to “dead man walking” - I think this could be the gateway for a lot of developers to move away from Windows. Just my personal opinion !

4 comments » | Code

stuff I notice now

September 23rd, 2008 — 3:04pm

A guy who works in the cafeteria where I work lost his son last week. I don’t know anything about how he died, I just know that the cafeteria put out a jar to make donations to the family.

I didn’t drop any money. I don’t know why. My mind kept racing with the thought of pulling $20 and putting it in the jar. But then I’d find myself walking away. Sometimes I don’t understand myself. I noticed that my mind is more existential than my physical being is. My mind wants to reach out to others while my body seems to walk away.

Then walking up the stairs this morning I thought about all the people that die every day. I hadn’t noticed before. But now with Dad and Grandma I notice everything. I noticed that there are people all around me grieving in some way. Everyone has lost someone.

I wanted to say to the guy in the cafeteria “I’m sorry for your loss”. But my throat got tight and I could feel emotion crawling up my back. So I just nodded. He smiled and saluted me like he does at lunch. I noticed that there are probably a lot of people that I interact with each day that have some form of grief and because I don’t know I treat them as all is well. And they play the part.

It makes me notice that I don’t say “how are you?” enough. Dad did all the time.

Comment » | Life

Time and pride

September 21st, 2008 — 4:28pm

So as I’m working on Siffer, I thought about something that I have had conversations about before. Pride and time. The pride a developer has over a design he/she created and the time it took to make it.

Evil - both of them.

See the problem with pride is that it doesn’t make any difference to the users of your software. They aren’t asking for your pride. They want the solution that they asked for. And they also want to change their mind. This totally conflicts with the developer pride. If you change something the developer is proud of, I guarantee that developer will have problems with the change. Doesn’t matter that the users are paying the developers check - it’s his pride.

Time is sort of a different thing. The users don’t want a lot of time taken. They want the solution tomorrow. But it takes time for some solutions to form. Sometimes the answers just don’t appear and it requires “do-overs” to get things right. Developers always (every single time) want more time. Especially when the developer is in over his head. Complexity will always dictate time. If the solution is complicated the time to finish it will be large.

So why the hell was I thinking about this? Well I was banging my head against the wall with a rather simple problem in Siffer. As I was trying to work through it I realized that the Ruby language allowed me to “quickly” change the solution … over and over again. New designs came one by one. Each one was different and failed to fix it until finally the right one revealed itself too me. My pride was not affected and it was rather quick. Time and Pride were not factors to the solution.

With other languages you have to spend a lot of up-front time in design. C# and Java require a lot of thought before you can really test the solution. Ruby isn’t that way. With the former languages your pride gets baked into the solution and time of course is required. With the latter they are non-issue.

Interesting. Time and pride in my experience has ruined projects. They have sometimes made me look like an ass and on occasion made me lose interest and tune out a whole project.

Comment » | Code

Back to top