MidnightReign.org

Incoherent Keyboard Bashing

Browsing Posts in General

Raging at Ruby on Rails

No comments

As usual, I have been bored (not that there’s a lack of things to do – but one requires stimulation – and not in the sexual kind of way, although I definitely wouldn’t say no), so I decided to look at Ruby on Rails.  Admittedly I’m probably a complete moron when it comes to looking things up, per se, but I battled to find decent beginner information on rails, and ruby and how everything fits together in the scheme of things. Sure, there are ruby tutorials, and rails tutorials, but I just couldn’t find anything that actually made sense to my warped frame of mind. I did quite a bit of googling, clicking on links from rubyonrails.org and ruby-lang.org, and reading of pages and such.  I even subscribed to some podcasts.

Eventually I figured out that Phusion Passenger was the correct way to run Rails applications on Apache, so I looked into installing that.  Unfortunately Phusion passenger requires apache2-mpm-worker which allows apache to use multiple threads. It completely replaces apache2-mpm-prefork, the default non-threaded model which the apache php5 module requires. And since everything on my web server is php based, this presented a problem. Fortunately it’s not a huge problem, as the workaround is to set up php5-cgi using FastCGI, which actually has more pros than cons. It’s definitely a better way to run php – the speed boost was definitely noticeable to me, and I didn’t pick up any issues with any of the sites.  Fortunately it didn’t take me too long to convert the sites to use FastCGI. Downtime was less than 5 minutes.

I then installed ruby, and rails from the stock repositories. Turns out this wasn’t a great idea, as by default it was ruby 1.8… and I’m obsessed with using the latest version of things. So I installed ruby 1.9. Then I discovered that it still wasn’t the latest, and it wasn’t in the repository.  So I upgraded my server OS to the latest release. And it had ruby 1.9.1. And even that patch level wasn’t even close to the latest version.

In the mean time, I found http://railstutorial.org. The newest tutorial deals with Rails 3.0, which is currently at version 3.00rc, and when you install that version of rails, it warns you that it may not function correctly with version 1.9.1 and to rather install 1.9.2 when it was released. Fan-bloody-tastic. I went ahead anyway, but had some issues getting the app to run properly. I kept getting odd errors, and there were messages about the app not finding certain gems that were, in fact, installed. It was painful.

So I figured, what the hell. I’d remove the OS-provided ruby and all the little bits and bobs, and I would compile ruby from scratch, and install it using checkinstall, so I could at least remove it.

I grabbed the most recent version (1.9.1p429 at the time) off ruby-lang.org, and tried to compile it, but received a compiler error. Googling told me I should try doing make optflags=-O3. That worked, but I got another error further along. Googling again told me that I should try running ./configure –enable-shared. So I did, and I ended up with a compiled ruby. I ran make install via checkinstall, and I was happy.

Actually, not. For some reason I checked the ruby-lang site, and discovered that the latest patch release was now 1.9.1.p430. What the…? It had been p429 just minutes ago, I swear!  I even thought that maybe I had actually downloaded p430, but the internal version number perhaps hadn’t changed… but I checked the downloaded archive, and it was definitely p429, the version.h said so.  So I downloaded the p430 archive, checked the version.h – it’s patch level 430. So I compile it. I run ./ruby -v. It returns 1.9.1-429.

Now I was incredibly confused. I grab the nightly snapshot. The version.h says it is version 1.9.3. Compile it, and run ./ruby -v. Also version 1.9.1-429.

I realised that it must be reading something from the installed version of ruby, so I remove it, and run ./ruby -v.  It returns an error about not finding libruby-1.9.1.so.

After a lot of thinking and considering, I decided that my best plan of action would be to grab a nightly build, and setup a package build via checkinstall. So I did just that. Although I think after this whole exercise, I’ve compiled ruby about 20 times now. But at least I now have a decent script that pretty much automates the getting, compiling and building of the package.

And I have a test site gurgling quite nicely under phusion passenger (modrails/modrack).

Of course, I’m leaving out a fair amount of detail about researching other frameworks and testing those out. The swearing about getting passenger to do what the docs say it should do (the OS-distro of it was old. Typical), and that kind of thing.  At least now I should hopefully be in a position to start actually learning how to use Rails via that tutorial I mentioned earlier.

Maybe.

Bah! Werewolves

No comments

I hate movies / tv series that depict werewolves as actual wolves. How boring. I much prefer the half man half beast type creature of popular monster movies.

Beware of the domain scams…

Comments off

Back in 2004, I wrote about a company doing domain scams – trying to scare people into thinking that someone else was trying to register domain names that are similar to their own. It seems this practise has become very popular, as I am seeing many of these types of scams going through various mail systems.  I try block them where I can, but you can't stop em all. They mostly seem to originate from China these days.

So, just be warned, that if you get an email from some company – particularly from China – that "someone" is trying to register your "intellectual property" (as they tend to call it), just delete it. It's a scam to try get you to register domain names that you don't need at incredibly high prices.  Personally, I usually respond with a 'Fuck off', but that's just me.

Chat Splat

1 comment

This took place on GTalk a moment ago:

1:36 PM Alexander: i know
i know
ok
1:37 PM so this thing works very well
now it's a question of playing with it
and test it with posterous
me: the more you play with it the harder it gets
Alexander: well, up to a point
WHAT?!
NO!!1
me: ROFL
1:39 PM Alexander: uncool

Damnit. What is it with these damn themes that keep fucking up the formatting?

Uh-oh

Comments off

Found this on a friend’s blog, so thought I’d take the test (Oh, and my style is screwing with the colour scheme and I’m too lazy to try fix it):

The Dante’s Inferno Test has banished you to the Seventh Level of Hell! Here is how you matched up against all the levels:

Level Score
Purgatory (Repenting Believers) Very Low
Level 1 – Limbo (Virtuous Non-Believers) Very Low
Level 2 (Lustful) High
Level 3 (Gluttonous) Moderate
Level 4 (Prodigal and Avaricious) Low
Level 5 (Wrathful and Gloomy) High
Level 6 – The City of Dis (Heretics) Very High
Level 7 (Violent) Very High
Level 8- the Malebolge (Fraudulent, Malicious, Panderers) High
Level 9 – Cocytus (Treacherous) High
Take the Dante’s Inferno Hell Test

Welcome to 2010 – Where power outages are becoming the norm

Comments off

Although I’m not sure how great it is, yet. So far we’ve gotten off to a fairly rocky start on the home front.

We’ve had so many power failures, it’s just not funny any more. Our local municipality (Ekurhuleni) seems to be completely unable to prevent these ‘faults’ from occurring. Yeah, ‘fault’s. These ‘faults’ always considerately occur right on the top of the hour. Quite amazing that.

Apart from the occasional Saturday power outage, which usually went off around 9am to come back around 3pm, we have now progressed to large outages. Yesterday, we lost power at 7am. Power returned at 6pm.  Today, the power went off at 6am. Only returned after 5pm.  Going on that schedule, I’m guessing we will be cut at 5am.

It pisses me off that these morons just cut power when they feel like it. It’s worse when I’m sleeping because of my cpap. Nothing worse than waking up because you can’t take a breath anymore.

Jackasses Abound

Comments off

It’s lunch time, and I walked into a spicy fast food joint in the mall across the way from where I work. It’s fairly early for lunch, being 11h30-ish, but I like it since there’s no crowds, and no queues.

A guy is standing quite far back from the counter with a bewildered expression on his face, apparently looking at the animated menus on the screens above the counter. It looks to me like he’s already ordered, he’s probably just waiting for his food, as I see he’s holding a 1 litre coke bottle in his hands. So I mosey on past him, and move right up to the counter.  The young girl asks me if I want to order.  Next thing, the bewildered guy verbally lays into the girl. I don’t know exactly what was said as I don’t speak the language, but I picked up a few words here and there.  Apparently he was lambasting her for not asking him for his order as he was there first.  She told him that she did ask him, but he ignored her.

He was standing miles away from the counter, staring in to space. What the hell? If you want to order, move up to the counter. Jackass.

Powered by WordPress Web Design by SRS Solutions © 2010 MidnightReign.org Design by SRS Solutions

Bad Behavior has blocked 67 access attempts in the last 7 days.