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.

Need More Focus: iPhone Development

In the beginning, this post was just titled “Need More Focus”. I was going to talk about how I’ve been working towards making HanMeta a self-sustaining entity.

But then, I watching the iPhone OS 3.0 preview presentation after coming home. Then, I had to make some very quick decision about how I’m going to reach that goal.

How Far I Have Come: A Review

2009 started with a bout of laziness. Definitely a lot of resting, clutching onto the 360, all the while, trying to figure out what I wanted to with the blog. The month of January was spent on learning more and more about dealing with the Linux server as I moved my blog to slicehost and hoped to launch a Rails app on the same slice.

Oh, the joys of being the linux admin. Definitely learned to fear (the respect kind… and… the other kind, too… who are these great demigods placed on the Earth anyway?) the server admins that power the Pipes.

I visited Seattle later that month, and came back refreshed, ready to bite into something hard. I chose the guitar. Yes, the real kind, although, I did end up returning to the awesomeness that is Rock Band. I learned about how to learn again. (I’ve been writing up this in another post.)

February: a week or two was spent on learning Cocoa and iPhone development. It was a nice break from trying to futz around with linux server administration. DevPhone 2009 was extremely important in helping me get started. Also, there was a nice (much shorter) presentation on iPhone Development for Education at NCSA. And of course, I can’t leave out Hillegass’s amazing book on Cocoa Programming.

After that, my desire to finish a web application started to flare up again. I started hacking away with some libraries that I would need to make FeedSt a reality. Instead of doing a feed reader, I decided to finish up an easier non-paid project called GadgetGet. This was around the beginning of March.

Of course, on top of this, earlier this month, I started a tiny little podcast called JKast. All the while, there were blog posts waiting to be written.

The Multiple JKs

I sat down yesterday, trying to figure out how to divide up my focus. Instead, I avoided making any decision and continued to read Atlas Shrugged, a book that I’ve been meaning to read ever since I found out that there was a yearly scholarship for it back in college. It being in the news, I just had to get it for the Kindle to test some fiction reading on it.

Today, it hit me. I need to start focusing. Now.

Why Not Earlier?

The reasoning behind trying to do both Web and Desktop development was simple: To be awesome twice. Of course, what I forgot was that cloning hasn’t been perfected yet. And even then, why would the world need a second me? Ridiculous.

Is it the newness of the iPhone SDK? Is it the third 2 L of Dew I just cracked open in four days? Maybe, but I find myself wanting to do more iPhone development, over all the Rails hacking I’ve been doing. It could be because of all the other things that I have been having trouble with; more correctly, it could be because of all the other things that I’ve been learning.

Heck, my skills in vi/m has increased significantly. I find myself wanting the shortcuts in all circumstances. rails.vim, a vim plugin, totally blows my mind every time I load up MacVim. My desires to do things with the shortest amount of keystrokes and the least amount of time has been on the rise, with more and more usage of Quicksilver and GeekTools. The server admin insanity helped me understand more and more about the state of the Internet in general. Also, gaining a much more deep understanding of git and deployment through Heroku so I can just sidestep almost all the server admin pain…

So, I don’t discount the fact that my desire to learn and implement a web app has gotten be very far. It’s just that, from the business standpoint, time to market and any form of money seems to be much faster with the iPhone.

I also feel that there are many more possibilities for interesting human to computer interactions with the iPhone than a traditional web app. The other data provided by just having an iPhone from the GPS, accelerometer… and now, other iPhones in proximity… At times, it just feels more real to me. You’re touching your UI elements, goodness.

Also, I need to act on this excitement. I took way too long to commit myself to Rails. I’m still wondering why I didn’t latch onto it back in 2006, when I knew full well that was what I wanted then.

But again, learning from mistakes, and pushing forward. Hard.

Game Plan

It’s simple: Get it done. All the while, enjoy the awesome-izing process.

I could bore you with the list of things I want to get done, but I’ll do it in my notebook instead. Really, I want to make sure that the process I go through stays as transparent as possible.

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.

Day 3: Regroup

After a normal sleep cycle, I returned to my computer to start cracking.

Of course, life threw its usual curveballs. After church, I had realized that my printer was being wonky. I also realized that NewEgg’s return policy on broken items sucks (you have to pay for shipping for sending it back), which makes me not want to order from them ever again unless it’s something like an.. xbox live 12+1 month card. (Which I didn’t get from them, because buy.com has it better. DO IT.) I’m probably continue to order from Amazon… I love everything about this company, from Prime down to its amazing return policy.

That took a while, then I had a couple hours of fun on the guitar as well as the 360. Eh, it was bound to happen.

Productivity

Then I buckled down. I realized all the physical needs of a human being, including sleeping and eating, really gets in the way of doing some productive work. I worked on and am still working on organizing all the web “properties” I have. I’m talking email addresses to AIM screen names to… you guessed it, domain names. Yesterday night, I did something I should have done a while back.

I finally bought joshk.im. Currently, I’m beta testing something called SweetCron, which is perfect for the purpose of that site. I have this strange feeling this might be a project I look forward to committing some changes to. Yes, even though it’s PHP… but it’s so well written! So pretty! I’ve never seen CodeIgniter code before, and it looks very very clean. I’m only used to seeing the insanity that is Symfony. It might just be that the guy who’s writing this thing, Yong Fook, is quite good. It was interesting to find out that SweetCron was going open source just as I found his blog a couple months ago. I really do hope for great things, if he’s reading this.

But alas, I may do something else with my newly acquired shiny domain name. I’m fresh out of ideas at this point, but I really wanted it to be a site for just that.

So What’s The Next Project?

I’m still figuring this out. I hope to have a list of my requirements for this project. Here’s a preliminary list:

  • Must not depend on advertising as the main stream of revenue
    • Basically comes down to freemiums or charge per use.
  • Must use Rails (if I’m doing a web project)
    • This is to learn Rails, btw… I’m not saying Rails is the end all for web projects.
  • Must be doable by “myself”
    • I’m sure I’ll be hitting up people left and right for help, but largely, it has to be my own.
    • It could be a source of pride, but I need to make sure I can do something on my own.
  • Must not neglect health of body and mind
    • This is like… uber important. Must maintain some kind of healthy habits.
  • Must blog daily progress reports, like this one
    • Accountability: So people can call me out. Important thing is to stay truthful.
    • You’re going to see lots of FAIL on this blog starting from… before this blog started to the day I die. I hope to see more WINs in the days to come, though.
    • Maybe, possibly, someone else is trying to do something like I’m doing. Maybe by doing this, I can find someone else who’s trying to do it his or her own way.

Sidepoint: Blogging Schedule

So I’m looking back on February 2008′s posts, and it seems like I stopped blogging like a madman after I found Twitter. Then this blog turned into, for lack of a better phrase, a Twitter archive. But before then, when I actually contributed to the world with some meaningful posts on the web… ugh… 2.0 market and on life in general, I would have multiple posts in various stages of completion.

I’m back at that stage. I have screenshots and halfway finished posts all over the place. I may need to slow down a bit, but I feel so energized.

I want to have these daily blog entries about the status of the “project”, but that doesn’t mean I won’t be doing some other random updates along the way. I have a feeling something about Rock Band 2 is going to get posted. Effing Braid needs to get a good review also. So many lovely post ideas…

Completely Random

Man, what the heck did I do with all this time I’m using up for the blog? I really have no idea. Must have been watching and playing things… Hmm. If I could have tracked all that lost time… but really, what’s the point then? What’s the point of being meta with things that you can’t change if you’ve already changed and are looking back?

Ah, the meta-life post. [Creates a new draft] I’ve deleted and rewritten this post so many times, physically, electronically, and mentally. ARGH.

Time to Start

Sitting in front of my computer. 8 PM. I have the next 4 hours to rock out on any projects I would like.

Eyes hurting. Wrists burning. Ankles twitching. Whatever.

I really haven’t done a project in a while. It’s interesting to start up again.

Too many things swirl up in my mind. The biz hat. The dev hat. Do I have to wear both? I guess for a little while, I’m going to try and develop this thing on my own. It’ll be a good experience to see how much I know and how much more I don’t.

I have a large amount of past diagrams and outlines I’ve created, just for this moment. Months and months of planning. Just planning. No code. Just diagrams on napkins and dreams in my mind.

My skills in JavaScript is lacking, but I’ve already decided on jQuery as the library of choice. My skills in Ruby is lacking, but I’ve already decided on Rails as the choice (and even though I hear lovely things about Merb).

Stressing the Intro

I remember in high school, I was told to start with the body of the intro-body-conclusion style essays… That it helps somehow in the formation of the essay.

I could never do it that way. I had to just start. Start from the intro. Just start busting it out. Then an impromptu list would begin to form, out of thin air. I’d start formulating the arguments and throwing down the supporting points.

In that same way, I have to just start.

What’s really making me afraid is I’ve never written a book in this manner before. The fear is that I’ll be going down the wrong path.

No, I don’t want to hear about Rails not scaling. It’s not that at all. It’s the fact that this initial plan might somewhere along the line hamper the projects growth. The fact that, if I don’t position my first step correctly, I’ll sprain my ankle and miss out on the season to come.

But to run… even that marathon… I guess each step is a risk. All of life is a risk.

So suck it up. And be awesome instead.

Goals for tonight?

Start coding. Even one line will do. Just one. And then we’ll see where it goes from here.

Chances are, I’ll end up throwing that single line away anyway. Don’t think too much about the source management tool you’ll end up using, the bug tracking system you’ll end up working with, the browser incompatibility you’ll have to deal with…

Take a holistic approach. This is sometimes a problem of mine, and it applies for anything as big as this. I think that’s the way with a lot of people.

Sidenote: I have to understand that some of my weaknesses and downfalls are presented in the whole human race. I need to stop thinking that my problems are so much more important than others.

One line. Time to get cracking. Oh, that one line, and maybe a couple posts or something.

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.

FRICK, Focusing is HARD

Seriously. I’m writing this as an effort to get me back on track.

At least, with working out, you didn’t really have to think. You’d count, and memorize. And push yourself to your limit. But there wasn’t any of this planning or thinking or critiquing…

Programming with the crew at HanMeta is FUN. But man, it’s freaking draining after a day of work at NCSA. I might be able to get a few hours in every night, plus all the other personal crap I have to do.

And just because it’s fun, it doesn’t mean it’s draining. I guess I signed up for this when I made HanMeta anyway. My eyes hurt immensely.

Yeap. That’s all that you’re going to get from this blogger today. Wee.

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.