RubyNoob Reborn!

June 28th, 2007

After months and months of neglect, primarily due to the fact that I’ve had tons of problems getting Typo to run properly on Dreamhost, I have finally revived RubyNoob running in Mephisto! RubyNoob is up and running on a slice from SliceHost, being served by Litespeed.

I’m planning on writing up some guides on how I did the transition from Typo and Dreamhost to Mephisto and Slicehost, but first I’d like to thank Paul over at UsefulJaja for creating the incredible tutorials that I followed in setting up my new slice.

As I’m writing this, the new RubyNoob is using the plain generic Mephisto theme. I’m planning on slowly evolving my own theme over the next few months. I’m hardly a web designer or expert in CSS, but it’s time that I learn and what I’d like to do isn’t really anything spectacular or complicated.

Since my last useful posts I’ve learned a lot of stuff about Ruby on Rails. I’ve added a full e-commerce solution to JoyLi.net by integrating it with Google Checkout. That was a great experience and I’ll be writing about that as well.

If you’re reading this, you’ve found your way to the new RubyNoob (or your RSS subscription actually figured out what happened and I’m amazed) and I’d like to thank you for stopping by. Let’s hope I keep the ball rolling from here on out!

Note: all comments since the migration have been given the date of the migration, sometime in June 2007. Please ignore all the comment dates.

Rails + Errors + FastGI == Bad

January 24th, 2007

One way to generate a lot of “500 – Application Failed” errors in Ruby on Rails applications running on Dreamhost is by throwing a lot of errors. Right now my newly downloaded Typo (supposedly the most recent stable version) is throwing some errors and this is, in part, causing RubyNoob to keep going down.

I’m investigating this to see what I can figure out. My advice is, if you’re running Rails on Dreamhost and you keep getting application failure errors, the first place to look is your production.log file. Make sure to clear up all errors first.

I’ll talk about what else you can do once I get RubyNoob a bit more stable.

Long story short for those who aren't thrilled with my prose. If your Rails log file(s) are growing too large, log into your shell account and run this:

rake clear_logs
Now, back to the REST of the story:
Read the rest of this entry

Lightbox Test

April 18th, 2006


Let the page load all the way and then click the picture for some cool, built-into-typo Ajaxy fun. This is made possible with a typo macro so I just typed in psuedo-html like this:
1
2



If you are running typo, you'll find instructions for this on the Filters admin tab down in the Macro section toward the bottom of the page. Click on the help link for the Lightbox post-processing filter. Cool stuff!
The wedding last night was great fun! Thanks Sally!!! Now back to our previously scheduled rubynoob article. This busy weekend my goal was to figure out why the Amazon toolbar wouldn't work for me. Here's what the sidebar looks like:
Amazon sidebar component
My problem, though, is that it doesn't quite work as expected. I tried linking Amazon books in several different ways with no success. I just couldn't figure out how to make it work. So, I figured that investigating the component would be a great way to learn a little bit more about Rails, and I was right! Long story short - in order to get typo to create sidebar links to Amazon items, you need to choose a text filter in the blog settings page which uses the Amazon post-processing filter. None of the default text filters uses the Amazon post-processing filter, so you'll either need to create a new one or edit an existing one and make sure to include the it as well as inserting your Amazon associate's id. I couldn't find any documentation anywhere that spells this out, but the rest of this article explains how I figured this out. Read the rest of this entry

Setting breakpoints in Rails

April 15th, 2006

In order to understand what was going on with the Amazon sidebar component, I found it necessary to set a breakpoint and examine the some variables. Let's take a look at how Ruby on Rails lets you set breakpoints and what you can do with them.

In my meatspace copy of Agile Web Development with Rails, page 196 is where I found the directions for what to do. Here's what I did:
Read the rest of this entry

Test Post

April 15th, 2006

I'm testing to see if I learned anything about the Amazon sidebar component.

Programming Ruby.

Yes! Success! I have figured out how to make the Amazon sidebar component work and work with the Amazon javascript stuff. I will be writing an article about what I learned soon, including my experiences with the debugger.
new typo

Wow! I feel like I've accomplished stuff tonight. First, let me say that the documentation for just about everything Ruby on Rails leaves a LOT to be desired. I'm hoping someone comes along eventually and fills in all of the holes. Of course, with there being SO many different ways to do things, documenting all of them won't be easy.

Now, let me see if I can document all of the steps I went through to get the latest version of Typo running in my dev environment. First, how did I get the latest version? Here's the page where I got started. In order to get the latest copy of typo, you need to type "svn checkout svn://typosphere.org/typo/trunk typo" from the command line.
Read the rest of this entry

Typo running in InstantRails

April 14th, 2006

typo

Well, getting typo up and running in a development environment was an awful lot easier than I had thought! I downloaded InstantRails, extracted it to my hard drive (it took a really, REALLY long time to extract), and followed the instructions found here. Once Instant Rails was on my computer it only took a few minutes to get typo fired up.

Sadly, though, I'm not quite ready to tackle typo development. Instant Rails comes with typo 2.6 which is apparently really, really old. The Amazon sidebar component that I want to modify didn't exist in this build. Major bummer! So now I'm off to figure out how to put the latest typo into Instant Rails. More reports to come!

Progress Report 2

April 14th, 2006

I've made it through chapters 10 and 11 in the Pragmatic Programmer's Agile Web Development with Rails book. I'm starting on the Testing chapter which is the last chapter before the book begins going into in-depth Rails discussion.

I've also been reading more in the Programming Ruby book - kind of jumping around from topic to topic. Whatever interests me. I'm getting really jumpy to start on some sort of project.

So, I'm going to try to get started on a couple of things this weekend. First, I want to get typo up and running on my local dev box. I want to start getting an idea of how it all works.

In particular, I want to figure out the Amazon sidebar component. As you can see, it's not displaying books on RubyNoob. I'm pretty sure this is because I'm using Amazon's spiffy javascript doodad to display those info windows when you mouse over a book's URL. The script apparently modifies the link in such a way that the sidebar's code can no longer read it. I'm going to try to fix that. It may be an impossible task, but on the surface at least it sounds easy enough.

So, hopefully by Monday I'll be well into the meat of the Agile book and have a modified Amazon sidebar component. Whether I get it to work or not, I'll try to document my experiences here.
Yesterday, I wrote an article about the resources that I'm using to study Ruby. I included a link to Amazon's page for the Pragmatic Programmer's Ruby book, and then I wanted to use the nifty Amazon Associate's javascript doodad that makes a window pop up when you hover over the link. Go try it - it's really cool!

In order to get the javascript doodad to work, you need to add some script codes at the bottom of your page. Amazon suggests that you put it in the footer. So, where's the freakin' typo footer? Assuming that you're using the default azure theme, it's in:

/rails/your_typo_app_name/themes/azure/layouts

The file you want to edit is default.rhtml. If you look in that file, all the way at the bottom is the footer for your blog. In this div is where I stuck the Amazon script code.

Of course, it's not that easy. When I refreshed my browser window, I didn't see any change. I examed the source code and didn't see the new stuff in the footer. So, it looks like typo is caching something. How do we refresh or republish the typo stuff?

Simple. Open your typo's admin page. On the Blog Settings page, scroll alllll the way down to the bottom and click on "Empty Fragment Cache." This will make the change go live! Now the groovy javascript doodad from Amazon works just fine.
typo pic

Overall, installing typo wasn't too horrible. Let's start at the beginning:

Earlier today, when I decided that I needed to start this blog, I looked around for a hosting provider. My primary criteria was that the provider needed to fully support Ruby on Rails, be forward thinking, appear professional and hopefully have an existing customer base that have already forged a path to Typo for me.

I found a list of Ruby on Rails hosting providers here. Looking around, I was drawn, for whatever reason, to RazorLogix.net. Nice site, great features, and the price was right.

Two things, though, sealed the deal with RazorLogix for me. First, my buddy, Lakshmi, uses TextDrive. Initially, I was really interested in TextDrive because it has a lot of buzz surrounding it. Unfortunately, when I looked at their plans, their $12/month plan only offers 3GB/month of bandwitdth. My other blog, TADSpot, on occaision rises up to almost 10GB of traffic in a month.

The other factor in RazorLogix favor is this fantastic article on Installing Typo over at Peter Arden's blog. Peter is using RazorLogix as well, and in email told me he'd had good success with them so far. So, I created RubyNoob.com and went for it!

So, to installing typo... I followed Peter's directions exactly. Everything worked as expected, except for the fact that I'm a bit of a tard. After following the directions, I couldn't figure out how to get to my Typo blog. So, I found some instructions mentioning symlinks, and I tried to set one up, but I did it wrong.

Check this link out to see how I resolved my problem. That, plus Peter's article were all I needed. Now I have typo up and running! Woooooooooooo!