Subdued Reflections

July 27th, 2010

Since my recent 25th birthday I’ve been pondering everything that happened my 24th year of life and I am having an arduous time trying to find good memories. The moments that should have been happy moments I was more often than not completely blithe to. Truth be realized, there was not a single moment I was raptured in utter happiness.

Let’s be clear it is not an issue of being depressed. It’s also not an issue of believing God somehow dealt me a poor hand in life. He gave me an embarrassingly high IQ and eidetic memory mixed with thorough creative, analytical and athletic abilities, I’ve never had to overly-worry about my needs being met, and I know the wholeness that comes with repenting your sins and placing your faith in Christ for your salvation. I truly have nothing to be desiderate about.

That being disclosed, It has taken a year of reflections to finally start deducing what really has been bothering me, and I have come to the realization that it is actually two intertwined items weighing on my soul.

The Drive

I have a cardinal rule in life. Every morning, without exception, in the mirror I stare through my eyes into my soul and honestly ask myself:

“If I die soon, would I do what I am about to do today?”

Life is such that if you are honest you will always have “No” days, but if the bare honest answer is “No” too many days in a row, something needs to change.

Until I turned 24, this served me well in setting priorities to help satisfy my insatiable drive to succeed. I cannot remember anything I have tried to do in life I have not achieved. However, since turning 24 a year ago, my daily answer every day has been “No, I wouldn’t do today what I am about to do”. So what changed?

After a year of wrestling with this, I am finally starting to figure out the issue. I know I haven’t lost my drive and I still have big dreams I’m working hard toward every day. The problem lays in the outcome of the dreams. What is the value of success? We all want wealth, recognition, and influence, but I find these wants have largely lost their appeal to me. The crux of the waning of their appeal I only started to comprehend recently… bringing us to issue two: The Who.

The Who

My drive to succeed has had what I believed the necessary need, and now I believe unfortunate consequence, of not committing to people. I never allowed myself the time to get to know most of the people whose paths mine wove across. “I do not have the time” is my usual line of thought.

I did not realize until recently that deep down I have a lot of regrets about the relationships, both friends and girlfriends, that I threw away to have the time to succeed. Would I go back and do it differently? No. I am happy with what I have accomplished thus far in life and the groundwork I have laid for accomplishments in the upcoming years is exciting. Do I regret it nonetheless? I now believe perhaps I do.

The Quandary

Last Friday I came to the postulation that what has been devouring my ability to say “Yes” to my daily reflection the past year are the following questions:

What is the value of success if you are too busy trying to succeed to enjoy life and the companionship of others?

Can you truly have both? Or does it have to be a balance?

The quandary of what I need to actually change in my life and dreams to be able to say “yes” in the morning continues. Pray I find inspiration soon as the burden of a year of “No, I wouldn’t.” every day is starting to vanquish my soul.

—————–
now playing: Lecrae – Fall Back (feat. Trip Lee)

Rails 3: lib directory files now need to be manually required

July 27th, 2010

Today Rails 3 Release Candidate was released. I upgraded the application I’m currently building and to my great displeasure discovered:

active_support/inflector/methods.rb:124:in
`block in constantize':
uninitialized constant [class] (NameError)

Turns out the custom library files you write and store in the ‘lib’ directory of your app are no longer automatically included on application boot. Luckily the fix is simple. In your Application.rb configuration file add the following line to automatically load all ruby files in the ‘lib’ directory:

Dir.glob("./lib/*.{rb}").each { |file| require file }

Hopefully this can save someone time and frustration.

—————–
now playing : Jes – Ghost

Rails 3 howto: restricting named routes to specific http methods

June 10th, 2010

Migrating my project’s codebase to Rails 3 beta from Rails 2.3.x was fairly painless except for the changes to the router.

Most files only needed a few changes, but my highly customized routes.rb file was a four hour ordeal that I hope this post can help save someone else time as Rails 3 documentation for declaring methods for named routes is sparse at best right now.

The premise of what my app needs to have happen is the RESTful routes that are automatically created by scaffolding need to be modified to live at my domain’s root without relying on any web server tricks. For the rest of this post let’s focus on just one of these overrides: the “new” verb for the “events” controller.

Default route created via scaffolding is:

http://domain.com/events/new

However, I want the new_event helper to point to:

http://domain.com/new

In Rails 2.3.x this is accomplished via declaring a named route with a conditions statement restricting to only ‘GET’ requests:

map.new_event 'new.:format',

:controller=>"events",

:action=>"new",

:conditions => {:method => :get}

In Rails 3, the new way to do named routes looks like:

match 'new(.:format)' => 'events#new',

:as => 'new_event'

Seems simple, but when the conditions statement restricting to only the ‘GET’ method is added it’s ignored.
The following does NOT work:

match 'new(.:format)' => 'events#new',

:as => 'new_event',

:conditions => {:method => :get}

In Rails 3 the ‘method’ condition is ignored by design because the proper way to limit the named route override to a specific http method is:

get 'new(.:format)' => 'events#new',

:as => 'new_event'

The beginning keyword can be any one of the http methods: get, post, put, or delete

Pretty sexy to say the least!, just wish it was better documented. Hope this helps others out.?

—————–
now playing: Hans Zimmer & James Newton Howard – Molossus

Howto fix mysql gem not working with Rails 3 (OS X Snow Leopard)

June 7th, 2010

I ran into a problem where the MySQL gem would install properly but when I went to migrate my database it would fail with the following error:

Please install the mysql gem and try again: gem install mysql. rake aborted! no such file to load — mysql

It turns out that database gem requirements should be declared in the project’s Gemfile. Add the following line to the Gemfile:

gem ‘mysql’, :require => ‘mysql’

Then in the top directory of your rails application run:

bundle install

You should now be able to migrate your MySQL databases.

The technical change in Rails 3 that requires this extra step is that the bundler reads the gemfile and then creates links in either the [application directory]/.bundle directory to the system gems, or alternativly downloads and installs them into the [application directory]/.bundle directory.

The concept is to allow gems to be installed per project that do not need to be installed system-wide in the system gem repository. This helps to reduce version collisions and duplications. Both of which are highly important now that rails 3 allows multiple rails applications to live together.

—————–
now playing: Tiësto Feat. Maxi Jazz – Dance4Llife