Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Tuesday, January 20, 2015

I Can Feel it Deep Down, Waaaaaay Down.

Gonna be up late, I can feel it.
Writing features out for a rails webapp that will help me track my blood pressure.
I'm using a spreadsheet now.
It's taunting me. I bet my father-in-law would like something like this. Login, record some metrics, send to Dr.
Will be that simple.
It's 5 columns of data, a user, a date/time, 2 columns for the blood pressure, one for the heartrate.
It's coming together.
now to follow through.
I bet I don't sleep much.

Watch my twitter feed and this post for commits.

Sunday, September 28, 2014

More Late Night Ruby Fun

Late Friday/Early Saturday morning, after the wife and kids found solace in sleep, I sat awake in a fevered pitch to patch my laptops and ruby install. I had to install the bash exploit patch, because security!

I also had to take a good stab at compiling the ruby TK library that comes with it.
No luck there though.

I had an adventure when I updated Ruby to Ruby 2.1.3. Basically, I deleted my whole ruby installation and recompiled from source. This left me with no ruby gems. Fortunately, because of my previous late night ruby thinking session, I had a list of gems. It's a slightly dated list, I'd installed the rubyXL gem a couple of night ago, but it is a good start.
I've automated gem installation before, using a simple script to install the gems from a list. I decided to create a couple of stand alone methods and a short script to 1. Create a list of gems currently installed on the system. 2. Install the list of gems (while determining if a gem has already been installed). 3. Determine if any gems in the list I have are missing without installing any new gems.

Objective 1 was easily accomplished. I took my one-liner from the other night and broke it down into a method using a "do... end" block.

I chose to do the method this way because I believe it makes the method more readable. Plus, the rest of the methods in the file are multiline by necessity and it echoes their format.


Objective 2 provided more of a challenge. The original script I wrote installed all the gems listed whether they were already installed or not. Sometimes one gem depends on another for installation, so it gets installed before a gem further up the list. You can still "install" the gem, even if it's already been installed as a dependency, but this adds to the time the script takes to execute. I decided that if I had already installed a gem, whether as a dependency or as part of a previous installation, then I didn't want to reinstall it.


That was a good enough place to stop for the night.
Some cautionary notes:
I'm doing this on Ubuntu 14.04, and you'll see a sudo in there. A unix purist might say that it would be better to su to the superuser and execute without the sudo. I got no problem with that. Understand what you are doing when you use sudo. I execute this script because I wrote it and I know what it says. Don' t do nothin' with sudo you don't understand. That's how things get borked fast.

Also, I don't check for the existence of the gemlist.txt file. I haven't needed that functionality so I haven't created it.

Last night when I got home from work, I watched a little tv while doing laundry,  and then remembered that I'd left my little script here hanging. I still needed a way to check and see if a gem was in the gemlist.txt file.


The hardest part about writing this script was figuring out how to get two arrays created and then subtracting them. For some reason split wasn't behaving as expected. I chalk it up to general tiredness.

At the bottom of this file, I stitched my methods together using an if else ladder.

Everything works!
I know that choice #2 isn't really doing what it says it does. If a gem is already installed on the system, but not in the gemlist file, then it's not on both lists, and it's not installed, nor is it placed in the gemlist file.

Also, I'm sure that there's a better way to do the menu. Perhaps using a hash or something.
One thing this file won't do is install gems that aren't in your install path. Currently I have one gem installed that's built from the gemspec in the gem itself.
One way around this would be to store the gemlist in a csv file or perhaps a spreadsheet, and carry the installation path in there.
Right now though, the file is useful.
I've saved it as a gist on github.

Maybe you can find it useful too!

Sunday, September 21, 2014

"Way to Commit Soldier!"

I'm not a soldier, but that is one of the funnier lines in Madagascar 3.



The pertinent quote begins about 35 seconds in, but this whole scene is what I would call "high comedy".

I do however, want to commit, especially when it comes to committing more code that is. For 13 of the last 14 days, I've made at least one commit to projects I'm working on under Github. I want better programming skills. I believe that the best way to become a better programmer is to read code every day, and write code every day. Sometimes, the code I write isn't very complicated. Saturday I restructured the way I had some test steps written in a code library that will serve as the math problem generation engine for an application I'm developing for my kids. It wasn't very complicated, didn't change the world, but my habits were shaped into a design where such a refactor becomes automatic in the next code library. Other projects I've been working on are an effort to track student reading habits that reports out to a spreadsheet, and a ruby gem that serves as a wrapper for the EBird API.
I'm practicing and learning several different things at once. In my own code libraries, I'm practicing how to develop using the  "Red, Green, Refactor" methodology of cucumber and RSpec. I'm also learning how to write tests that make sense for code libraries that already exist, and I'm learning how to upgrade a library with the latest implementation of that library's methods and objects.
In short, I'm having fun, lots of challenging fun. It's the sort of fun that leads to more and better opportunities for employment and personal development. Committing every day reminds me of what I love about programming, each solution to a program is a unique implementation of patterns, and I love those patterns. It's like the rotunda in Beethoven's works, not the same, but the same is there when he gets around to it. The Bible says in Ecclesiastes chapter 5:

  18 Behold, what I have seen to be good and fitting is to eat and drink and find enjoyment in all the toil with which one toils under the sun the few days of his life that God has given him, for this is his lot.  19 Everyone also to whom God has given wealth and possessions and power to enjoy them, and to accept his lot and rejoice in his toil—this is the gift of God.
 I hope your work helps you find enjoyment. I know what little bit of programming I do at work helps me enjoy my job. I know it encourages me to seek out further skill so I can advance and enjoy it even more. Committing code every day shows me the enjoyment of my toil, and I believe there's nothing better you can do than enjoy whatever it is you are doing.

Saturday, September 6, 2014

Some Quick Late Night Ruby Fun

I should be asleep, but I'm not. Instead I'm up hacking around with ruby, taking some online classes, and generally having a good time.
In an effort to train myself in one discipline, I'm taking some online classes for ruby/ruby on rails/webdevelopment.

The kids and wife have all gone to bed, so I went through a course level about the ActiveSupport library, and started playing around in IRB with what I had learned. Eventually I found myself exercising one of my favorite ruby "koans" : writing a list of the gems I have installed on my computer into a text file. In the past I wrote this as a script that I would execute shortly before system updates or new ruby builds, so I can quickly install the ruby gems I use.

One of the things I've always wanted to do is "get it on one line" of ruby code. I started by executing the following in irb:

`gem list`

The backticks around gem list tell the interpreter "Go to your native environment (bash in this case) and execute the command gem list". The result is  a list of gems, including all the current versions installed, listed like so:

"twitter (5.11.0, 5.10.0, 5.9.0)\ntzinfo (1.2.2, 1.2.1, 1.1.0)\nuglifier (2.5.3, 2.5.1, 2.5.0)\nwatchr (0.7)\nxpath (2.0.0)\nyajl-ruby (1.2.1)\nzip (2.0.2)\n"

That's cool, but I don't necessarily need to know the versions. So the next step was to remove the versions from gems. I needed a regex and gsub to do that.

`gem list`.gsub(/\s[(].*[)]/, "")

this means, "Give me a string where we substitute everything in between two sets of parentheses including the parentheses and the space in front of the opening parenthesis, with an empty string."
That gave me something that looked like:

"twitter\ntzinfo\nuglifier\nwatchr\nxpath\nyajl-ruby\nzip\n"

This gave me a single string of the list of gems installed. I then rediscovered how to open a file and properly write to the file. Several iterations of using File.open do blocks later, I decide to go ahead and use the script below to write the file all in one line:

File.open("gemlist.txt", "w") {|file| file.write `gem list`.gsub(/\s[(].*[)]/, "")}
Now when I use a text editor to view gemlist.txt I see this:

twitter
tzinfo
uglifier
watchr
xpath
yajl-ruby
zip

And more importantly, I can use ruby to parse the file, and reload the gems I need to reinstall next time I build ruby!

The end!

Thursday, December 9, 2010

RSpec Book is Out!

Yays!
I bought this book like forever ago, and it's finally in print!
I want to say that so far I like the paper version as much as the electronic, and now that I basically only have one computer it makes following the examples in the book so much easier.

If you are looking to learn behaviour driven development, and the tools behind it, pick it up!
enjoy!
ok,
I'll go back in my hole...

Thursday, October 28, 2010

Using Ruby for Something Not Rails.

Hello!
So, I fell in love with ruby before I knew what ruby on rails was about. I started using ruby because I remembered the thrill of using my computer to actually write the software I needed to get a particular job done. I especially was excited because with ruby, I could run something across many platforms with little modification, in theory. In the old school world of line numbered BASIC, one had to tailor tune the BASIC to his or her platform. I used the Commodore 64, perhaps the creme de la creme, but still, different than AT&T, Tandy, or IBM. Often, the differences were subtle, and I hated going to school, and using the TRS-80's or Apple IIe's because I felt they changed the BASIC only because they wanted me use their software. Incidentally, this became the seeds to my use of Open Software, before I knew about Richard Stallman.
Back to the Ruby.
Chris Pine is my hero. If you've never read Learning to Program you should, even if you are the most amazing 1337 h4xx0r there is. I discovered it while trying to find a language I could love as deeply as I loved my Commodore. Ruby is it.
I worked my way through the book, and began using ruby for various things in my computer, the most coolest of which is updating itself.
That's right, I use ruby to update itself.
Every whenever I want to, I build ruby from source using a little script I hacked together on a whim. In the process of writing it, I learned how ruby does things like change directory in a linux environment, and how adding a puts in there can make things more verbose.
Here's the gist of it: upruby I know it's not much, but it's powerful, and can be improved, and I am interested in hearing how you would improve it. I've been thinking of parameterizing certain elements, and having the file run off of a configuration file. I keep everything invisible to non admin users for obvious reasons, so I don't have to worry about maliciously destroying my /dev/sda. I've also thought about making it a general script to update a lot of different things, and making it so it will run as a cron job, or perhaps only run when I am expressly logged in as the root user, and not merely sudo runnable, just because I don't want to have an issue with something taking a while (like updating all the gems) and have to enter my sudo password multiple times.

I am interested in hearing about how you would handle this situation. How would you adapt this script to run your updates?
That is all!
Next post is going to be all about amateur radio! I hope you are as excited as I am about that!
l8rz,
gb hoyt

Thursday, October 14, 2010

New Ubuntu, or My Meerkat be Maverick!

So I took some time Monday and installed the latest and greatest Ubuntu, 10.10 Maverick Meerkat.
Let me say this,
I am getting tired of installing a new OS every Six months, lol.
That being said, Maverick Meerkat is pretty slick. I did a fresh install, completely wiping out my old system, although I did do quite a bit of copying my files from a backup once the installation was complete. Everything seems to run a little better now, I am using the "Proprietary" video driver, I haven't installed apache or Drupal. The machine is running smoothly, and cooler. The fans definately are not working as hard. Maybe they finally got flash right! I have installed ruby, from source, following the instructions I previously gave for Ubuntu 10.04. I didn't doubt they would still be valid, having done this long enough to understand when I stand a chance of changing something that will break everything else. Everything is in a different font than before. I don't understand how that makes things better, but I think it does. Somehow, I have convinced myself that the rounder looking font has made the electrons move faster, and therefore, boosted computer performance.

In a nutshell, I like it, but I'm tired of liking something every six months.
l8rz.

Friday, October 1, 2010

FLPR vs LAMP

Ok,
I have about a dozen grand projects tumbling about my cranium at any given moment. The most important involve taking my love of computers and programming, and turning it into profit so that one day, when I am rich, I can feed homeless people all the time. One idea that has been bubbling on the biggest back burner has been to make myself marketable as a website designer/online application developer. To do this, I have studied several approaches, and am near making something useful. First, you must have a system to develop upon, and a system to receive the code. I am of the opinion that the two should match, if not the exact hardware, then most certainly OS/application versions, file versions, etc. I see the wisdom in this approach because at work we have two systems running basically the same thing. One is MS SQL Server 2000, the other is MS SQL Server 2005. Both machines have a 'dev', 'test', and 'production' instance, and the process we use for promoting changes in the system is different for each machine. People, this is a product made by the same company! It's kinda scary to me to think that there are vastly different ways of doing thing just in the different versions of the same software.

Granted, FOSS *nix operating systems and software is a little different, grep is grep and vim is vim (and awexome, suck that EMACS boys!) no matter the *nix, but there are some differences. Take for instance the Ubuntu version of shutdown and the FreeBSD version of shutdown, they both can shutdown the computer, but in Ubuntu it's `shutdown -h now`, and in FreeBSD it's `shutdown -p now`. The difference is huge! in FreeBSD `shutdown -h now` will only halt the system, in ubuntu it powers down. So what's a boy to do? remember two different shutdown commands? maybe, so what if I do?

Personally, as I get older, I am finding it easier to just use one system for developing, and one system to deploy. It's hard for me to invest in learning a gobjillion ways of doing something, so TIMTOWDI is great when gettin' my hack on, but horrible when actually deploying an application.

sigh.
I am rambling to say this, php is not for me I think. I am sure I will be learning more of it, and will be using it from time to time, but I will not find it enjoyable. I love ruby too much. It's exactly what I want and expect in a scripting/programming language. My LAMP cannot be a LAMP, I need something else, another acronym:
FLPR
FLPR stands for FreeBSD, Lighttpd, PostgreSQL, Ruby(or Rails), and it is going to be my deployment platform. I am not sure exactly what I will be deploying yet, Antlers perhaps? but one day, I will be deploying something. I have two obstacles to overcome,
1. Ubuntu has made me OS lazy. I don't know as much as I should about Linux. I've been using it almost exclusively for the past four years, and I used it for two year (way back in the day!) in highschool. Ubuntu does a lot of things for me, so I have been focusing on developing my skills as a generic programmer instead of a competent sys admin. It's only natural right? I abhor specialization though. sigh, that's a different matter.
2. I don't know a thing about lighttpd. It's going to have a learning curve. It's going to be a while before I have to worry about it as I develop my first application, but that brings up another problem. I want to use it because I keep asking myself Can rails scale? and figure even if it does happen to scale very nicely, I still want a fast webserver, the hardware on my deployment machine ain't exactly state o' the art.


the hard target here is the FreeBSD way of doing things. Currently, I utilize the most recent ruby, the most recent rails, and I use rubygems to manage my gems. That is not the FreeBSD way. I am not even sure how to do things my way on a FreeBSD platform. Should that be a clue? Why not just use Linux? Simplest answer to that is "because I don't want to" :P It is honestly, a little more complicated than that, but that would be a political discussion, and it would also be an adventure in missing the point. here are some issues I have had with FreeBSD recently (6 months to a year ago)
1. FreeBSD uses ports to install gems, and perhaps my google-fu needs practice, but I haven't been able to discover a good way to use rubygems to install gems in FreeBSD instead of the ports. Gems need to be installed via gems, not via ports. I cannot compromise there.
2. Related to item 1: ruby on FreeBSD is old. I think I can fix that, at least I will be able to, or maybe I can get a friend to look at it for me, and guide us on the way.
Once these two issues are sorted out, i will begin developing an awesome application. until then, I languish along.

l8rz.

Tuesday, September 28, 2010

Source Installation of Ruby in Ubuntu

In order to get ruby 1.9.2 running on Ubuntu 10.04 (or before, it's been the primary OS I've been using since 2006) you will have to build from source. Don't let your 'newness' scare you, I was just as new when I started doing it a while back, and I learned a lot about source code and the build process. Hopefully you can benefit from my mistakes, I mean, "experience" :)
First things first:

1. You will have to uninstall your current ruby. All gems, all ruby libraries. Everything. When you build something in Ubuntu, the resulting binaries are kept in a different place than if you install from a package. Installed packages go to /usr/bin/ and home rolled binaries go to /usr/local/bin/. The difference is huge. Packages installed in /usr/bin/ are maintained by the package manager. If you delete a package there, your package manager (synaptic) won't like it. Packages installed in /usr/local/bin are your responsibility. You will have to keep the binaries installed there up to date. No big deal, I'll share a little script I wrote (in ruby) to do just that after I am done explaining how to get to that point.
2. Go ahead and download the source code. Normally, I would tell you to grab dependencies, but I want you to get the source code now for a reason. Read this page, http://www.ruby-lang.org/en/news/2010/08/18/ruby-1-9-2-is-released/ and then download the source that ends in .tar.gz
3. Open a command terminal (Applications > Accessories > Terminal Its Icon is a black box with ">_" inside of it.
issue the command "tar -xzvf /path/to/tar.gz" if you download things to the Downloads folder it will be
tar -xzvf ./Downloads/ruby-1.9.2-p0.tar.gz
notice the little dot in front of the first /? that means "start looking in this directory."

You can use the tab button to complete the command, for instance I would type tar -xzvf ./Down and the tab would complete the folder name and then "ru" to complete the .tar.gz filename. Tab completion is laziness at its best!

4. after the tar command works its beautiful magic, type
cd ./ruby/ext/
that will put you in the ruby source code directory for ruby extension libraries. now type
ls
to list out all the files and directories in this folder.
What I am having you do is look at the various pieces of ruby that may or may not install when it's installation time. It will help you install dependencies.

5. Time to hunt for dependencies! Open synaptic and start searching. Use the real search tool, not the quick search. The packages you need to install end in "-dev". These packages are actually C header files the make tool will use to build your ruby!

6. You still have your terminal open right? Most of the entries you see are directories that contain the source code for building different parts of the ruby library. Ruby doesn't *technically* need these these parts to be ruby, but they do make ruby useful. The bad news is that you have to have the dependencies installed in order to compile the source contained in these directories.

7. Back to Synaptic! Before you build ruby, you need to install some packages that will let you build anything. First search for something called "build essential" The first package that results will let you build source code, click it, and get it ready to install, you are not done yet. Second, search for "autoconf". You will need it to preconfigure the building of ruby. Next search for a package called "bison" You will need to check that one to install as well. The final tool you will need is "subversion", which is how ruby keeps track of itself once you are ready to download the absolute freshest source code. Now let's find some libraries that ruby depends upon. First, search for "readline dev" This one is tricky because you will find the package you want listed as "libreadline5-dev" there are a lot of choices, because there is much variety in the readline library. I compile my ruby with readline 5. Now search for "openssl" This one is really tricky, because the library you actually want to install is called "libssl-dev" There is wisdom to be gained by looking around at the results of your search, namely that there are libraries that have the name 'ruby' in them! Do not install them! You are on a different path. Their path is the one you are leaving. One benefit of installing the openssl development library is that it also depends upon the zlib library, which ruby also needs! Two dependencies for the price of one!

8. Install the packages. It may take a while.

9. Now that those packages are installed, you are ready to go back to the terminal and begin building ruby. Go to your terminal and type "cd .." That means, "change directory, to the one immediately below this one." That should be the root directory of your ruby source code. The magic begins now.

10. First, type "ls", and look at what is there. A lot of files end in ".c" : That's your source code! In a minute it will become your ruby mine. Next, you need to type "sudo autoconf" at the command prompt. That will generate a "configure" script that you use to configure your source code to your environment.

11. next you will need to type "./configure --enable-shared" notice the . and the / in front of configure. they mean 'use the configure command located in this directory, furthermore, use the flag that will configure the source to generate shared objects library.' The shared objects library is important if you want to use shoes, or rails.

12. Time to make! Type "sudo make" and watch the code work. It should take a few minutes, but at the end, you will see success.

13. Test the code! Type "sudo make test" to test the code. If it passes, you will be ready to install.

14. Install the built code! Type "sudo make install". This will install the code you will be running.

15. Now you need to clean up your mess. You want to leave your source clean, so you type "sudo make clean" to clean it up.

16. You have the ruby! Yippee, but you are not done. First visit the Ruby Core Page and look at how to install the source code.
Mull it over!
Are you really bold?
http://pastie.org/1187982 for my script on updating my ruby.

Thursday, October 1, 2009

Ruby Foo and the Art of Application Development

Hmmmm,
I'm thinking about what it takes to write really good programs. I'm thinking about this a lot lately, because I want to earn a living writing really good, useful, soul searching programs. So let's talk about cucumber. I discovered cucumber about 10 months ago, right when it was starting to become usable. The team I was working with used cucumber for writing stories in their development cycle. The whole BDD/TDD development process was new (and still is new) to me at the time, but I was having fun, and it seemed to me that this cucumber thing was great fun. I had no idea what it really did.

I suppose you should be making fun of me, it's not after all, very reasonable to use a tool you understand nothing about, but I am a jump then look kinda guy when it comes to some things, and learning is one of them (sometimes). I did what any reasonable person does after discovering something shiny and nifty, I bought a book about it.

Actually, what I bought was a promise for a book, at a special discount. The simply named The Rspec Book is a great lil' book. It's not released yet, but it's in 'beta' mode. That means I get regular updates when Dave, or Aslak, or whoever updates the book. I got it round about version 4, it's on version 10 and set to release in it's final version in December of this year. I'll get a hard copy of the book once it's officially released too. Personally, I think that this is a great way to do publishing. Since this book was first announced/released, there have been several changes to the methodology of running cucumber and rspec. There have been minor syntax changes, new habits for namespacing, etc. The book remains current. I mean, it is seriously Agile (must be Italian)! It's easy to read if you are a n00b or if you are a wannabe (like me), and the support the guys give with the Rspec and Cucumber groups online is outstanding.

The book takes you on a journey through the methodology of Acceptance test driven planning, Domain Driven Design, and Test Driven Development. This triad forms the basis for Behavior Driven Development (BDD), a system by which good software 'emerges' from the process by writing the code that answers the questions users ask.

I'll leave you with that for now.
I :heart: you guys.

G. Brandon Hoyt

Thursday, April 16, 2009

So it's April, and you Know what that Means!

Counting down the release of Jaunty Jackalope, Ubuntu 9.04!
hehehe!

so, i'm writing a few apps right now, right, mostly focused on one webapp (top secret at this time), but also dabbling in something i've always wanted to do, write a cli to take some of the mystery out of sshing into a client computer. so far, so good. I might even push it to github, just for giggles. I don't think it's really useful, but it has been fun to say the least.

so far I've written the menu and a validation block for the menu. hey it's a start. now I've got to store data in a file that the compy can read. Me being a rails guy, you'd think I'd use a database, but this is a highschool type of project, and I'll solve it using a highschool type solution, text values using csv's!
awexome!
It's Pascal all over again!
l8tz

Monday, September 8, 2008

Beware your editor!

So,
I have a new jorb! Doing Ruby on Rails work even! I quash bugs and recently had a little editor snafu that I didn't catch right away. You probably already know this, but don't make my mistakes.

Usually, when it comes to text editing I use Geany on Linux. It's a nifty little design, and it's pretty simple to add snippets and what not. Sometimes though, when I'm tired and not thinking straight, I'll use good ol gedit. Hey, it comes with Ubuntu, does some pretty good syntax highlighting, and I don't think it's bad, it just does some default actions I don't like. The dang thing automagically backs up whatever file you are using! That's not a bad thing when you are doing something in say the /etc/ or /boot/ directory, but when you are using git to manage source code on a rails application, and you accidentally gedit your config/database.yml file, you can quite easily add commit and push your automagickally generated config/database.yml~ file containing your topsekrit mysql passwd for all your team to see!

I know I did!
what a n00b/dweeb...

one day i has 1337 sk1lz.
GB Hoyt

Wednesday, August 13, 2008

To Cut a Precious Rock

Howdy!
Recently several security vulnerabilities discovered in ruby reared their ugly head, and a fix was in order. Now if you are an Ubuntu user like myself you quickly discover that while Hardy Heron was shipped with the latest and greatest patch for ruby in its day, it often lags seriously when it comes to security updates. The best solution, I think, in such a case is to go ahead, bite the bullet and compile ruby (or any other software for that matter) from scratch. I call this the best solution because after some brief searching for a package version of 1.8.7, I had an adventure.

What you need to understand is that when I say I had and adventure, what I mean is that something went horribly wrong. It started with fireworks. The wonderful night blissfully waxed, and I sat enjoying the latest issue of Linux Pro magazine, reading some useful article about Totem (mainly useful for putting me to sleep) and gradually feeling the weight of my eyelids increase, when all of a sudden, BANG!!! Blah, some neighborhood kiddie decided 12:37 was a great time to light firecrackers. Startled me awake enough to make me want to hack something. In this case, I ran headlong into the ruby prollum. Previous attempts at compiling ruby from source were only marginally successful. I utterly failed when it came to compiling a useful ruby, especially when it came to be generating something useful for rails, and let's face it. When it comes to making money with your Ruby programming knowledge, rails is going to be your best bet. In my effort to grace my lappy named (aptly I might add) "PortableFun" with some excellent ruby versionings, I discovered that Google is a fickle friend. I'll never trust it the same again. In short, I discovered This "Nerd's Only" site when googling the phrase upgrading ubuntu 8.04 ruby 1.8.7 or some esoteric combination thereof. I followed instructions, and still, my tired brain musta did something very bad, or I didn't have the switch flipped to "More Magic" or something, because I wound up updating about half of my core packages to the 8.10 version of ubuntu!

Yeah for fail! Now I not only didn't have ruby 1.8.7, i didn't even have a working os. I took this as a sign that sleep was more important than ruby at this point. The next day I reinstalled my os, reinstalled all the important packages I thought I needed to make things work, and got back to fixin' the ruby problem. With much trepidation, I ventured back to the backstabber, Google, and tried another link. Throwing caution to the wind, I discovered a wonder place full of joy called Tag Ubuntu, and they seemed to understand my problem. Compiling ruby is a matter of knowing what all you need to enable. The source code comes with many wonderful libraries, and options, but it's so flexible it won't do crap unless you specifically ask it to look for that crap in place x in your filesystem. I followed these instructions:

$ tar zxvf ruby-1.8.7-XXX.tar.gz
$ cd ruby-1.8.7-XXX
$ ./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr --with-zlib-dir=/usr --enable-shared --enable-pthread --enable-install-doc
$ make
$ sudo make install

You are responsible for finding the tarball, usually the latest and greatest is available at The Main Ruby Site and untarring it wherever you want to compile the code. That little snippet was pretty much word for word from the ubuntu blog, but I did add the last three ./configure tags cause I find them useful.

Once I had ruby 1.8.7 installed, I got the latest issue of rubygems and installed it and then had a lot of fun installing a lot of gems.

hopefully someone can use this meandering thought page to get themselves up and running on ruby 1.8.7

I loves me the rails!
GB Hoyt

Tuesday, May 6, 2008

Exciting things afoot...

M'k ya'll listen up,
it's my daughter's third birthday! Yeah!
we marked this milestone by taking her to the dentist, and having four teeth removed and replaced with a bridge. Does that make me a mean dad?
maybe, but we did have a party saturday already, and it rawked! She's at her grandmother's house recuperating along with my traumatized wife. Poor things.

anywho:
Did install the heron on the ole lappy... ... and the lappy is about dead me thinks. Fans are goin' down, it's just a matter of tiempo. stupid fans...
who wants to buy me a mac?

ok, so weird ruby thing I learned last week:
entering:
system("cd ./some_dir/") will not change directories!
cd is not a command found in bin. idk what's up with that, enlighten me oh great Internet Mystics!

Thursday, April 17, 2008

First Fruit!

If you consider squash a fruit, my garden is bearing fruit!

first one came out yesterday, and i planted two more seeding maters, some betterboys to be exact. some of the romas are in bloom, and soon we'll be up to our garterbelts in tomatoes!
i can't wait.

pepper plants are doin' fine too.

i silently thanked a foraging bluejay yesterday i spied chompin' on some insects round the garden. birds are awesome like that.

some notes on C++
it's lame compared to ruby, but at the same time it grows on you. the structure takes a while to appear, but at least it's not as bad as something totally lame like visual basic at least.

lets face it, you'll not be using gedit or anything sans smart tab complete to write a vb program, yet w/ c++ there are shortcuts.

ruby is still my baby though.

it's a wonderful mess.

PIECE OUT!!
GB HOYT

Sunday, April 13, 2008

weeeeeee!!

we are stinking awake.
i hate being awake when i should be asleep, it's a primary motivation for getting a new job.
anywon hiring a c++ n00b?
ruby jr h4xx0r?
rails wannabee?
i only need like 55k a year.
PIECE OUT!!
GB

Thursday, April 10, 2008

mk...

ok, this is for random thoughtness, and updates involving my general social life, programming adventures, randomnesss, and linking type actions to other, more focused blogs...
ok, brb...