Back to Blog

Why Didn’t My Octopress Work?

Posted by Flatiron School on July 25, 2013

The following is a guest post by Ruthie Nachmany and originally appeared on her blog. Ruthie is currently a student at The Flatiron School. You can follow her on Twitter here.

My octopress blog works now, but it wasn’t working for a while. I’ve overheard from some of my classmates at Flatiron that they are experiencing this as well. Below – a short and sweet post about how I figured out what was wrong and how to fix it.

On July 11, I tried to post a blog post and got an epic error when I tried to rake deploy. I wish I had it copied here somewhere but I am pretty sure I closed all terminal windows that had that error by now. I’ve heard about logs, but I’m not sure where these live so this will have to be a work of imagination on your part. It was a very long paragraph with many regular expression slashes that ended by saying “regexp error”. Definitely a little scary; I find those regular expression slashes a bit aggressive myself. Furthermore, there was no documentation or discussion online with this particular error, so that was weird.

Interestingly, when I was presenting the blog post for July 11, my classmate Max (maxjacobson.github.io) was able to find my post through this link (https://github.com/ruthienachmany/ruthienachmany.github.io/blob/a401e7128313b5176b361ae67003ec935d8b05f6/source/_posts/2013-07-10-preparing-for-my-first-tech-talk.markdown) – or in other words, it was on my repo, but did not reploy correctly to my octopress site.

Then I avoided the problem for a while.

Then I was like, hm, I feel like expressing myself again, so I tried to write another blog post, hoping the error forgot about itself. No such luck. I sat with my TA Jon (http://jonathangrover.com) and compared our octopresses. The only difference we could discern was that his posts were saved in a branch called ‘gh-pages’ while mine were in ‘source’. We looked into it, but determined that it was not the problem, both because in the octopress documentation, both are presented as approaches for posting blogs, and also because I had previously been able to deploy my posts.

However, as we were speaking, I noticed that we were running different versions of Ruby. Interesting… I started to think back to July 11. That was the Thursday after the 4th of July weekend. The 4th of July weekend happened when we were just starting to learn Rails – we had a half hour lecture on Rails, and then were set loose into our vacation to read books/documentation, learn about Rails, and enjoy the 4th. I was super excited, followed by slightly dejected, as I struggled to understand the multiple controllers of Rails (see my Sinatra vs. Rails blog post and presentation for more detailed descriptions of my struggles and process of understanding).

One of the big challenges was that Rails 4 came out right before we started learning Rails. We’re focusing on Rails 3 right now in class versus jumping straight into 4, both because the documentation is much richer for Rails 3 right now, because once you learn one version of Rails I think it is much easier to jump into the next, and because Avi said so (for good reason – it’s better to let someone else catch the bugs).

Despite all this, I naturally downloaded Rails 4 by mistake, and have been kind of atoning ever since. I’ve shambled through RVM, rewriting Gemfiles, and a variety of other potions for trying to make my Rails apps open in 3 vs 4.

My TA Ashley provided a helpful way to specify versions: rvm use ruby-1.9.3-p429 rvm gemset create rails3.2.13 rvm ruby-1.9.3-p429@rails3.2.13 gem install rails —version=3.2.13

But I kind of prefer my classmate Kirin’s (http://kirinm1.github.io/) approach, just for its simplicity: rails _3.2.13_new

Anyways, reflecting upon all this, I realized that I may have changed the version of Ruby I was running by mistake, and perhaps this was affecting my octopress malfunction.

I changed my version of Ruby back to 1.9.3 – and alas, it still didn’t work. Frustrated, I shut down my terminal and left octopress alone for a day.

Sometimes when you give someone a day to calm down, they become more reasonable, personable, and polite when you see them again, or take them to meet people. I was trying to show my friend Chris Lake (chhhris.github.io) my awful regular expression error yesterday. As I was demonstrating it, octopress asked me to bundle update RedCloth (https://github.com/jgarber/redcloth), which is part of the Gemfile.

From the gem’s site: “RedCloth is a module for using the Textile markup language in Ruby. Textile is a simple text format that can be converted to html, eliminating the need to use html directly to create documents, blogs, or web pages. Textile gives you readable text while you’re writing and beautiful text for your readers. If you need to break out into html, Textile allows you to do so easily.”

As perhaps you can anticipate by fact of reading this post, my blog now works.

Lessons learned:

  1. Installing Rails 4 (and trying to drop down) may be giving you problems with your octopress – if experiencing issues, explore which version of Ruby you are running.

  2. Get intimate with RVM. Understanding how this works will save you errors with lots of slashes in the future.

  3. Share your errors with your peers. Sometimes they will help you, either by identifying what the error is not (e.g. Max helped me understand that it was NOT a problem with uploading to my repo; John helped me understand that it was NOT an error with my branch and the conventions of Octopress). Sometimes they will help you by identifying what the error is. Other times, it is just kind of like the experience of calling your dad over and showing him a problem with the sink or circuitbreaker or your phone – as soon as you call him over, the problem goes away. Persistence is key!

About Flatiron School

More articles by Flatiron School