Wednesday, 31 October 2012

OS X jruby 1.7.0 "require: command not found"

Had tons of trouble with this.
I have rvm and "raw" installs of ruby and jruby.
I do this so I can simulate a live environment.
Our servers don't allow rvm installs, but I like to use it to test stuff.
So I have to have an install of jruby like this:

bandit:~ kim$ ls -l /opt
lrwxr-xr-x   1 kim     admin    11 30 Oct 23:00 jruby@ -> jruby-1.7.0
drwxr-xr-x   9 kim     admin   306 30 Oct 22:59 jruby-1.7.0/
drwxr-xr-x   9 kim     admin   306 11 Oct 15:43 jruby-1.7.0.RC2/

This allows me to switch back and forth.
The problem arises when you have your path pointing at /opt/jruby/bin and install rails.
When you verify all paths:

bandit:~ kim$ which jruby
bandit:~ kim$ which rails
bandit:~ kim$ rails -v
/opt/jruby-1.7.0/bin/rails: line 10: require: command not found
/opt/jruby-1.7.0/bin/rails: line 12: version: command not found
/opt/jruby-1.7.0/bin/rails: line 16: syntax error near unexpected token `('
/opt/jruby-1.7.0/bin/rails: line 16: `  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding'

Which is a pain in the ass.

The issue is sort of to do with the environment.
I was first was led down several garden paths regarding interference from rvm.
That's not the case.
At the top of the /opt/jruby-1.7.0/bin/rails script is this:


What happens is that the jruby script has this at the top:

#!/usr/bin/env bash

This starts a new bash with virtually no included stuff.
You can try it yourself by doing "env bash" and when the shell starts, poke around in the path.

And that's the problem.
OS-X has an primitive install of ruby, rails etc.
You can check it yourself.
Just do a "ls -l /usr/bin/r*".
You'll see rails, rake and so on.

So how do you fix this?
Simple. Change the line at the top of the /opt/jruby-1.7.0/bin/rails script to this:

#!/usr/bin/env jruby

Just leave the old line in for reference.

bandit:~ kim$ rails -v
Rails 3.2.8


Caveat: You'll have other issues with rake et al.

Saturday, 20 October 2012

Apologies for not doing more "normal" posts

For the last two weeks I have been very, very busy.
As such, I have only been able to provide the interesting news links and only "short" versions.

Two weeks ago, my mother had to be hospitalised again due to shortness of breath.
So she had to go to dialysis more times than normal to get the fluid off.

Then we signed up to foster cats.
So we had "Butter" for 2 weeks while he recovered from flu.
Seriously demanding little fuzz ball.
Now we have a 2 year old mother and her 5 kittens to help.

On top of that we have a deluge of work!

So apologies!

I promise to get back into writing normal posts soon!

Thursday, 11 October 2012

Worst Marketing Fail I've seen in Years!

Went to a "reject" store today. And saw the worst marketing fail we've seen for years. It's no wonder this isn't on the shelves at your local supermarket. What the hell were they thinking?

Monday, 1 October 2012

Buddha was a programmer and used twitter

Think about it.
Most of his quotes are under 140 characters and have a distinctly hacker flavour:

"Do not dwell on PHP, do not dream of Ruby, concentrate the mind on the money."

"C++ is more to be feared than a wild beast; a wild beast may wound your body, but C++ will wound your mind."

"Three things cannot be long hidden: C, Java, and Ruby."

"Better than a thousand hollow words, is one word that brings peace. Ruby."

"All wrong-doing arises because of PHP. If PHP is transformed can wrong-doing remain? Yes. It is called C++"

"I never see what has been done; I only see what remains to be done. Polish that turd"

"No one saves us but ourselves. No one can and no one may. We ourselves must walk the path to TDD."

"There are only two mistakes one can make along the road to truth; not going all the way, and not starting."

"A jug fills drop by drop. RTFM"

"It is PHP, not his enemy or foe, that lures him to evil ways."

"I do not believe in a fate that falls on men that do not test; but I do believe in a fate that falls on them unless they test."

"Even retirement is not to be feared by one who has coded C++ wisely."

"It is better to test well than to deploy suddenly."

Streams of Unconsciousness

Well, it's the first of the month.
So I'm starting a new tradition.
I'm going to gather all my lunatic blonde moment FB status updates together so they don't get lost.
So here they are:

9:30pm. Recovering. Still in pain but exercise and hot showers have reduced it. Reason: 75kg person tries to pick up 40kg bag of potting mix. Result: Spends rest of day and evening in bed in the dark with back pain and massive headache. Misses out on mexican dinner. Moral: I'm a frickin' idiot. Donut privilege rescinded.

Been going through our DVD collection. Did "Mon Oncle" by Jacques Tati. We watched it last night over fish and chips. Fantastic. The phrase ROTFL was completely physically correct. I loved the dogs and the whistling thing. If you want to weep with laughter, find a copy of it.

Holy crap.
Warp fields? Ok. Ok. This is not an easy paper to read. But... Warp fields? Holy crap!

Ok. This is weird.
Who goes fishing in a loo?

Ah. Classic. Came home. Nipped upstairs to check email etc. Came downstairs. Ben flaked out on sofa with lights off. Drank some wine. Tip toed around. Drank some wine. Put dinner making stuff away. Drank some wine. Went upstairs. Drank some wine. 9pm Ben wakes up. Too late for dinner for me. Ben berates me. Drank some wine. Check FB. Drank some wine. Far too late for dinner now. Drank some wine. Might have some cheese. Drank some wine. Screw it. Rip some more DVDs. Drank some wine. Time for bed. Another day without food. Such is life. Drank some wine. Yey!

Oh. Even more classic. Ben had kittens that I was prepared to eat nothing tonight. So he's cut a bun up into strips and toasted it. And buttered them. And put cheese (Vintage Tasty and Double Gloucester) out with Dolmades and what I call Frickin HUGE beans. He's so good to me. Love.

Just finished watching Cannonball Run.
Captain Chaos will save you!
Frickin' love it.

Ok. This really sounds like fun. For some values of fun that include being ostracised from society (and FB) that is.
A free guide. Actually it's a startling good guide on how to start ANY business on the net.
I'm thinking Diesel Powered Nuns as a starting point. Wonder what Google AdWords will show up...

Ok. This is a wait. What?!? moment. Seen the FB ads down the right hand side? Dunno if it's just me or demographics or what, but I keep seeing these ads with "Mom reveals XXX way to get rid of fat..." with varying degrees of credulity. But the thing that gets me is that most of them seem to require the use of a fruit that looks like a deep sea ocean nightmare. Fruit? That's not a fruit! It's a frickin' torture device used in Abu Graibh. If some cosmetician (or whatever the frick they call themselves nowadays) came at me with that demonic fruit in their hands I'd demand an exorcism on the spot. That while calling in a drone strike of course...

With my donut privilege re-instated, I decided to try some glazed donuts instead of the normal cinnamon ones. So we stopped by Krispy Kreme as I had been to their stores when I lived in the US and the range was amazing.
Phhhhbbbttt. Wrong. Thought: what the hell, and got 6 glazed ones. Bad move. I have to say the KK donuts are rubbish. I know there was donut dough in that morass of icing, but be buggered if I could find it. Hurt my gums like the devil. Won't be going back. Ever.

Ok. Here's an opportunity too big to miss. I NEED someone who can crochet. Why? You ask. Because I NEED THESE: The problem is that you can only get the designs. Not the actual product. ARGH! I NEED SOMEONE TO CROCHET THESE NOW!
Why? They're frick'n tanks! On your feet! How could you not understand? I'd Frickin' wear these to work. Miranda? Please? I'll Pay! I'll promise to wear them to work!

Having to fix some PHP code. I really hate PHP sometimes. There's a switch statement about 60 lines long that could have been done in one line!

Oh the irony. At least I think it's irony. Maybe just "real" you know.

I don't have a mouse MAT. I have a mouse RUG. Persian of course. And I've been eating potato chips. I now need a very small vacuum cleaner.

Charles Nutter remarked that the Πsymbol reminds him of a space invader or a jelly fish. I suggested that it looks like the Enterprise from above. What are your thoughts?

Ben gets so pissed off about chess puzzles. Mate in 1. But bug in program. Rant! Rant! Rant! It's a bug! Seriously. Bug. Don't stress.

Oh lord Cthulhu. Let me sleep. Questions. Can Rails3 successfully cache and chunk 2m mp3s? And how much porridge can you fit in a cat? And Ben wants to know whether inserting porridge into a cat is a challenge, question or a T-Shirt. I favour challenge.

Well that sucks. Ben has beat me 5 to 1 on dominos. I normally wipe the floor.

a) PHP sucks. Distracts you from what you want to do by making you go mad. b) There's a fly in here. Driving me nuts. c) So is the PHP.

Ah. Lost and confused. Just like the rest of us. I'm handbraking Dawn of the Dead right now. It's good to be confused.
Confused saves you from dealing with the loonies running the world. Like Romney. What is that all about? President Mit?!?.
Sounds like something you'd get in a german restaurant. "Bratwurst? Mitt Romney?" "Nein. Nein Romney." Confused yet? Go Bill Bailey!

If you stand on a robots toe and it says "sorry" can you conclude it's made in Canada? (Probably won't mean anything to any but Americans and Canadians)

Ok. This won't mean anything to any but IT and Sci-Fi nutters.
What names do you give your servers?
We have MOYA, LEXX, NOSTROMO and SULACO for example.
Really like 'Lewis & Clark', but it makes a tough name so we used them for two servers. Pop Quiz: Name the movie!
Be damned if I'll have 'Hunter-Gratzner' but it was the best cinematic spaceship crash of *ALL* time IMO. Blew the budget for the film on the crash!
"Don't you touch that lever Fry!" (Kick, Kick, Frickin passengers, Kick, Kick)

Ben is playing his new game. Borderlands 2. Love it. A Bazzilion guns and loads of Sci-Fi memes hidden away in plain sight... Saw the claptrap doing the Mars Attacks woman walk! Cool.

Just went out the back for an oral suppository and a fruit bat tried to crashland into a tree. I emphasise "tried". Hit every branch it sounded like. But it's valiant attempt to salvage some dignity was ruined when it was brought to a halt by a cabbage. Yes really. Went straight through the tree and hit the ground. It's dark so I can't see it, but I imagine it's doing what cats do when they do something similar: start licking their chests. Wait. Do bats lick their chests? Kinda interested to see that if they do.

Now this is interesting. Found this site. zombiestat. You enter the domain and it tells you what your miserable life^h^h^h^hsite is worth and tells you whether your site is 'safe'. The amount of telephone number dollar amounts shown is kinda cool. So my blog is worth $480. And ranked 1,279,778 in the world. Meh. Do I care? Actually 'yes'. Yes I do. Because I intend to get the site up to the one millionth rank. Challenge Accepted!

You know what pisses me off? Everything. For example: I was asked why do even bother to write things like this. So I said "I've lived long and prospered. Might as well write about it." They didn't get it.

Wow. Now there's a surprise. Go to google and type "mad squirrels" and view the images. There's some seriously psychotic rodents out there. Don't ask me why I typed that btw. Someone has to ask these questions.

Did you know it's possible to toast rye bread? You know that really dark bread seemingly made of mashed seeds?
Anyway, I went downstairs because I needed a Vegemite fix and discovered we had no "ordinary" bread.
We did have some buns, but my attempt to cut them sideways convinced me that toasted blood flavoured buns were a no-show.
But we did have rye. Challenge Accepted! First attempts were a fail. Think I discovered an organic substitute for bricks. Albeit small bricks. Trying to eat them was like trying to eat a slice of gravel. Although a house made of them would be kind of spectacular. Certainly you'd get an audience of birds.
Anyway, you have to watch the slices like a hawk and you can do it.
Unfortunately they don't go well with Vegemite. Fail!

Went to pay a ticket online (1st in 25yrs) and examined the document in detail today.
Under one section named "Evidence" I saw a single scrawled word: "Loser".
My blood began to boil at that point and I started hunting around the website trying to find a way to complain.
Fortunately sanity raised it's annoying head.
You know that little voice that keeps tapping on the back of your head saying "Heeeeellllooo! Wait you dumbass! Think!"
I examined the scrawl again and there was a faint little tick at the bottom of the "o".
I collapsed in laughter.
So.... Not "Loser" but "Laser" The speed gun thing.