Livereload: 1.4 Issues, Haml and Sass Files

Haml and Sass files are not included by default for livereload. I found this out as I was working on a static site mockup using Sinatra.

Take a look at the .livereload file in the directory you were running livereload in. Add this line to make the magic work.

config.exts << 'sass', 'haml'

Also, be sure to not be using livereload 1.4 right now. Make sure you’re using the 1.3 version of the extension also, as per this thread on github. Don’t delete the extension after you’ve installed it to Chrome, because Chrome doesn’t copy over the files into its own plugin folder somewhere. (This is, of course, from experience.)

// The problem I’m having right now when I want to share about all the lovely little issues and solutions I find is that I don’t like to blog it. I’m working on a different journaling system entirely. This post only happened because I’ve been in a blogging mood recently on multiple Tumblogs. Goes to show, keep doing it, whatever it is, daily, and it’ll become a part of your daily process.

PostgreSQL, Ruby, and Rails: WIN

This is a follow-up to my post: PostgreSQL, Ruby, and Rails: I Quit.

So I finally have a working machine with the following installed and ready to rock:

  • Ruby and Rails: From MacPorts

    • Tip: Don’t forget: “source ~/.profile”
    • Do not touch /etc/profile, even though Robby said so. (Although, I’d like to ask why he said to modify /etc/profile…) Everything else in that walkthrough is awesome.
      • /etc/profile is read-only. I really didn’t want to change this, and I even went and looked into /etc/paths.d. Don’t. You don’t need to.
    • Why not use the native Ruby that was shipped with Apple? That’s for another time.
  • Passenger(mod_rails) and PassengerPanes

    • My problem was after installing Ruby and Rubygems through MacPorts, I didn’t update the $PATH.
      • You do not need to create symbolic links (“ln”) at all. Just make sure to “source ~/.profile” after you’re done messing with the PATH variable in it.
    • PassengerPanes is amazing. Use it, and love it if you’re doing any testing on your mac before capistrano’ing the whole thing on a test server.
  • Git

    • Simple installation as “git-core” on MacPorts. I didn’t have any problems with this one.
  • PostgreSQL

    • MacPorts again. Makes sure to also install pgAdmin3, a nice GUI for PostgreSQL.

Which Gem? How To Install It?

If you go to the RubyForge page, you’ll see two gems. I still don’t understand why the releases were named with the “rb-” prefix (maybe to distinguish that it’s a ruby gem). Regardless, there are two gems listed “pg” and “postgres”.

Although “postgres” seems to be more out of date, this is the one that you’re going to want for the near future. Eventually, you’ll be wanting the “pg” gem. If you read some of the news, you’ll see that they’re also working on making sure that it works with Ruby 1.9.

Following yet another great walkthrough, you’re going to want to install it in this manner on an Intel Mac (if you installed PostgreSQL through MacPorts).

sudo env ARCHFLAGS="-arch i386" \
  gem install postgres -- \
  --with-pgsql-lib=/opt/local/lib/postgresql83 \
  --with-pgsql-include=/opt/local/include/postgresql83

PostgreSQL with Rails

Now that PostgreSQL is talking with Ruby, now let’s make Rails talk with it.

In config/database.yml, make sure the adaptor is set to “postgresql”, like so.

development:
adapter: postgresql
encoding: unicode
database: projectname_development
pool: 5
username: username
password: password

That was taken from the generated database.yml, which is done this way when you start your rails project.

rails projectname -d postgresql

My Thanks and Apologies

Thank you to all the blogs I’ve visited over and over again through Google queries. Some information was outdated (and at one point, this will also be outdated), but that’s how it is with anything web development, especially anything to do with Rails it seems. The speed at which this community keeps innovating continues to surprise me, and makes me happy that I made that choice to go with Rails (even though I struggled through it from time to time).

This doesn’t mean I’m done. Oh no, now I have to actually design, test, and develop on the stack I’ve created. I’m sure I’ll be sitting in on the Rails IRC room a couple times.

My apologies for not having a more complete walkthrough, although, I hope the links I’ve included will help out more. If you have any questions, just leave a comment, and I’ll try to help.

Now to keep on hackin’.

PostgreSQL, Ruby, and Rails: I Quit

EDIT: I got it to work, finally. I’m not sure what changed this time around, but here are some notes I made.

This was supposed to go out last Saturday, but my blog took precedence. Oh, that, and Fable 2. Shh.

If you’ve somehow found this post in search of an answer, I have nothing but a rant for you. If the post at Robby on Rails did not work… you’re out of luck, or you’ll have to keep going and finding a solution to the mess that I ran into while trying to use PostgreSQL as my database in Rails.

I must have read that post multiple times, trying to get this to work. I hope that there’s a fourth version of that post sometime in the future… I left a comment there:

I guess I’m waiting for the 4th version of this. I think the official gem now is “ruby-pg” at http://rubyforge.org/projects/ruby-pg.

Everything is perfectly installed, except for the PostgreSQL gem. I cannot get my first rake db:migrate to work properly. It keeps telling me to install the gem “activerecord-postgresql-adapter”, which I know doesn’t exist, and it’s just a general activerecord error. I’ve tried not only the “ruby-pg” gem, but also (the now older) “postgres” as well as the “pg” (I don’t know what this one is).

Are you still using the “postgres” gem? Are things working out?

I was looking forward to rocking out in PostgreSQL land this weekend, but spending hours and hours scouring the Internet… and nothing. I might think it’s because I’m running 8.3.4, the latest version. Anyone else having my problem?

And just underneath it, someone else seemed to be having the same problems (which kinda prompted me to write this in the first place).

I don’t even want to go and document the errors I’ve gotten… Yes, I know about the ARCHFLAG. I know about the –with-pgsql-include-dir and –with-pgsql-lib-dir. I tried binaries of each gem, and even compiling from source. Blah blah blah.

Let Me Show You, The Insanity… Or The Inanity…

I really wanted this post to be titled “PostgreSQL, Ruby, and Rails: WIN.” It just turned out that I couldn’t figure it all out. I felt pretty n00b after spending the better part of three days on this (two weekends, almost). Reading up on PostgreSQL, it just seemed much more open and fully featured. Being unable to actually get it working, I said, screw it, and went with MySQL (something that I’ve played around with before).

The last time I did this, it was before Rails 2.0. I remember it being fairly painless. But now, it seems like the most recent version of PostgreSQL (8.3.4) and the most recent version of Rails (2.1.1) doesn’t seem to work together all too well. I’m guessing it’s the gems, and so it might have to do with Ruby (1.8.7) also.

The PostgreSQL gems seemed to have undergone a couple of forks. I don’t have any problem with forking… but the naming of these gems are ridiculous. It doesn’t help that PostgreSQL is like the weirdest named SQL implementation out there (let me know if there’s something named weirder). Do you shorten PostgreSQL to pg? How about just postgres? Why not call it by the full name but lowercased, postgresql? Then you have to add the ruby portion: rb or ruby. While we’re at it, let’s also call the project name different from the actual gem name itself.

At least, this is how I see this insanity. It feels like there are at least four gems that do the same thing, regardless of them being out of date or not. (pg, postgres, postgres-pr, ruby-postgres…) I must have tried most of them, to no avail. In the end, it seems like “pg” is going to be the one to follow. I think. I’ll have to come back on this later whenever I feel like experimenting with PostgreSQL again.

From the actual PostgreSQL page on the Ruby on Rails Wiki (which is totally outdated at the time of this writing):

You can install a pure Ruby postgres driver called postgres-pr using Gems:

gem install postgres-pr Note that you still have to write adapter: postgresql and not adapter: postgres-pr in your database.yml.

A faster, native driver called “postgres” is also available. It can be installed with the command:

gem install postgres

What I Think Is The Right Gem

The wiki seems to be wrong, and I believe this to be correct (from the RubyForge page):

Ruby-pg provides the module “pg”, a Ruby interface to the PostgreSQL Relational Database Management System, which supersedes the old “postgres” module. This project also maintains fixes for the old “postgres” module.

Okay… so… “Ruby-pg” is the project name. They maintain two modules, “pg” and “postgres”, even though the packages themselves are called “ruby-pg” and “ruby-postgres”. ARGH.

So That’s It

Time to start rolling. For now, I’ll go the MySQL route. There’s a larger community of people using it, as with tools and documentation and such… I’m just a little bit slightly wary of the licensing of the two.

I give up: Why's Poignant Guide to Ruby

Why’s (Poignant) Guide to Ruby

If any single human being has read this book from beginning to end and can explain to me the insanity that is “why”, I’ll buy you a cup of coffee to do so.

I have given up on this book. From the looks of it, I’ve tried three different times over the course of about a year and got to about halfway (I’ve highlighted about halfway through).

Definitely poignant, but horrendously confusing. It definitely is a work of art, but I’m kinda impatient for this type of thing. Sometimes, the really really wonky humor is lost on me, and this, my friend, is a shining example of it.

Time to go back to the Pickaxe book.

Rails & The Hype Cycle

It’s eerie. I feel it. I feel it in the feed posts I should be getting.

There seems to be less and less feed items about Rails in general. I don’t know… maybe it’s just me… Obie Fernandez says otherwise:

Simply browse the ruby links on programming.reddit.com or the list of over 2000 ruby-related links on DZone to disprove that lie.

But I don’t know… just this gut feeling that I can’t shake that there’s this feeling of meh-ness in the community.

A lot of things have been leading up to this point for me. Working with PHP at work and having Java as the core for StatusFix (although I’m not actually doing Java, but just being this near to it… makes me feel a bit different) is helping me see more and more that there really is no silver bullet, no matter how much I want it.

But that’s merely just an aside. The point of this post comes from Global Nerdy.

Rails Hype Cycle

It’s very likely that we’re in or very near the Trough of Disillusionment stage in the hype cycle when it comes to Rails. Makes a lot of sense, if you ask me. The way I see it, the hype has worn off. And thank goodness it has, because finally, the Rails community can get to work on making awesome things and stop defending or attacking other positions.

As a crazed extremist that has to have his way, I feel like I’ve still got quite a long ways to go in maturing as a developer/manager. New technologies will come and go, and picking the right ones… well, that’s the hard part. It’s almost like… the stock market.

Another Weekend of Code

This past weekend was well spent, inside. Good thing I had enough food to last through the insanity that is freezing rain.

Definitely made some headway into what I wanted to do with the projects I have. Wrote some code, but mostly throwaway. Looked into a lot of the new Rails 2.0 stuff, but only to realize how little Rails I know period. Also added a third to HanMeta, and I hope to keep adding more people as time passes, and… you know… as I get grander ideas. I’m sure I’ll tap on some shoulders as time passes.

And hopefully, soon enough, LLC is in the future. Need a lawyer and an accountant… yikes.

And that’s all the update I have with regards to HanMeta. I have some nice wrist support gloves to aid me in my wrist painness and it feels like they are working.

Woo Hoo!

Probably the one of the few times you’ll see me type “2.0″.

jk$ rails -v
Rails 2.0.1

Now to make some magic happen.

Good thing there’s freezing rain this weekend. Even less reason to move away from the keyboard.

Got the Ball Rolling

The weekend was a blur. It went by too fast.

I made a trip to Madison, Wisconsin, where I met up with Amir to get this feed reader project off the ground. We didn’t code all the time, of course. We got a chance to see Superbad while it was still in theaters (when I first saw the previews for this movie, I knew I wanted to see this with the big Manj himself). I finally got a chance to play Metroid Prime 3 as well (which was cool).

I was happy to get the ball rolling. In the end, we didn’t get a lot of code down, but I felt like a lot of the foundations were laid into place… So many things I felt like I took for granted while running through the Depot application using Locomotive

Deployment of Rails Applications

But alas, this weekend has really pushed me to even more topics I need to quickly learn. Deployment of Rails is an amazingly tricky issue, and I have yet to see a coherent blog post on it. Hence, I bought the eBook Deploying Rails Application. Looks like a very good resource for all things Rails deployment.

Currently, we’re using Dreamhost (because it’s free, since Alex was cool with us using it) with FastCGI and Apache2. I hear it’s not the way to go. Oh the choices run the gamut from Lighthttpd, Mongrel, Pound, Nginx, blah, blah, blah.

Looks like one of the good ways to go is: Pounding Mongrel Light(tpd)ly

Something about Lighttpd rocking Apache, minus load balancing, which is taken care of by Pound…

Yes, I’m still confused. Much to test and learn.

Naming the Darn Thing

I really liked names that had to do with water due to the phrase “river of news”. “Firehose” and “Fire Hydrant” were suggested. We even went the tongue-in-cheek route and tried to name it something to do with garbage… refuse, debris, detritus… Foreign words… Latin words… I mean, this wasn’t the first naming session for this project.

In the end, we decided to not really belabor this issue any longer, and ended up just coming up with a standard way of naming milestones. Of course, this had to be funny, since it would be used internally.

We ended up with: Words that have to do with Christopher Walken sketches on Saturday Night Live.

Yes, I agree. It’s hilarious.

Of course, the first milestone project name had to be called “Cowbell”, from the infamous Blue Oyster Cult sketch involving “Gene Frenkel’s” (Will Ferrel’s) hilarious usage of the cowbell in the song “Don’t Fear the Reaper”. And who could the producer be? None other than Bruce Dickenson (). Yes. The Bruce Dickenson.

Why is this man so funny? I don’t even know if he’s trying… I wonder if he… talks like that… in real… life.

Or was that too Shatner?

The Date

Heck, I don’t even remember when I got the idea to do something silly like this. But I do remember coming up with a cool looking launch date not based on anything but the fact that it was a cool looking date. (For those of you wonder, that date was 07.07.07)

Regardless of what might have come before, September 1st, 2007 it is. The day when “Cowbell” started.

Time to put my pants on, one leg at a time. Except, once my pants are on…

Another Reason for NetBeans and Ruby

As posted previously, I’ve been looking into other alternatives to doing Rails, other than the industry-standard TextMate, and it seems like NetBeans is a viable choice.

Now I have another reason to use NetBeans (although, it seems like it’s a little bit slow for my tastes): Collab.

Reading through some more XP documentation, I come across the lovely page on Pair Programming. This isn’t something new, but I didn’t know that XP stressed this so much. I just kinda thought it was something you do if you can… but hey!

All code to be included in a production release is created by two people working together at a single computer. Pair programming increases software quality without impacting time to deliver. It is counter intuitive, but 2 people working at a single computer will add as much functionality as two working separately except that it will be much higher in quality. With increased quality comes big savings later in the project.

Emphasis are mine.

Wow. If that’s the case, I better start doing some more pair programming somehow. And seeing how the three team members on the project (Amir Manji, Derek Remund, and I) who are all four or more hours apart… I need something that’ll give me this wonderful ability.

I’ll continue to write on this IDE as I get more chance to play around with it.

EDIT: Of course, if I was smart enough to think things through, I would have checked if the same was implemented on Eclipse. Turns out… it is. It’s called “Eclipse Communication Framework“.

Frick on a Stick. I have to sit through both of these impressive Java IDE’s? Netbeans vs Eclipse?