carojane @ Launch Academy

a coding challenge.

Practical Magic

Woah, there. You thought things were going so well. You thought you knew your stuff. You thought, ‘Maybe I’ll actually make it as a web developer, after all.’

HA HA HA HA HA HA HA HA HA !!!

Okay, I’m not really horribly discouraged, and I’m not strugging completely, but I have to admit that the momentum has slowed down considerably this week.

It started out fine. We learned HTML and CSS, both of which I enjoy playing around with. I like frontend, though I’m not strong at it, and I want to learn more about CSS (especially using frameworks) and javascript.

The trouble started when we were introduced to Sinatra. Keeping a Ruby file nice and clean is important, which is true about html and css files as well. It’s important for readability and for making sure the program works by having matching variable names and calling the right methods. Keeping up with changes between the erb file and the ruby file in Sinatra, even when they are both nicely organized and clean, is a pain. Make one change here, the program crashes. Forget an argument here, the program crashes. And it’s much more difficult to zero in on the problem than it was just running a ruby program in iTerm.

And then Heroku came into play.

Heroku, it seems, hates pry. If I have require 'pry' at the top of my server.rb file, the site gives me an error. I had to figure out what was wrong by digging through hundreds of lines in the logs.

Now that I think about it, it probably has to go into the Gemfile in order to work. So, there’s that. The problem is that I set up Heroku by following a list of steps, which was more than problematic. Also, I’m not entirely sure I understood what went into each step.

First, in order to install the redis-cli library, I had to change the settings of usr/local/bin to be writtable. I write that as if I knew how to do that before I did it. I figured it out and got redis installed and linked, and changed my server.rb file to refer to a redis directory instead of a csv. I’m still not sure how it works, but it did, so I’m not looking a gift horse in the mouth on that one.

There were a few hickups with installing the Gemfile (copying word for word from the instructions lead to things not working sometimes), but it worked.

So, next, I deployed to heroku. It was a mess. It didn’t have css, so I had to go in and clean up where my files were linked, and then it stopped working altogether getting a “Internal Server Error”.

There was nothing in the logs that I could find that would explain it, so I went to the oracle (google.com) and searched there. The heroku faq had a step listed in its deployment instructions that weren’t in the instructions I was following:

1
$ heroku ps:scale web=1

And it worked. At least, it mostly worked. I got my website deployed, and it looked okay. But for some reason, every so often, it will come back with “Internal Server Error”. I have no idea what’s going on and the oracle isn’t helping, so I’m done playing for today.

Full disclosure, deploying to Heroku was an optional assignment, but I’m glad I did it. We will be going over deploying to the web soon, and I’m happy to have the learning experience out of the way. For the rest of the weekend, I’m going to learn some javaScript and check out css frameworks.

We finished stage ‘Alpha’ this week, which covered the fundimentals of Ruby, HTML and CSS, as well as Sinatra. The next two weeks are in stage ‘Bravo’, where we will be databasing it up, along with learning Object Oriented design. I’m ready.