Some Ruby Gems are better than others. Some are great once they are working, but how to get them working is not always obvious… BlueCloth (the Ruby implementation of Markdown) is one of these. Unfortunately, simply doing sudo gem install BlueCloth is not enough. The BlueCloth home page, a Trac site, does not tell you squat about it either. So what do you do? Well, as with any gem that doesn’t just install easily and work with a simple require 'gem_name_here', the first thing to do is look in the gem’s directory!!If you do not know where your gems are, at the command line do gem environment and you will see the path to your gems. Copy that path and cd to it. Then do ls and you will see you’re still not there. cd gems will get you into the proper directory for the gems.Once there, you will notice that each gem has a directory with the name and version number of the gem itself. In this case, cd BlueCloth* should be enough to get you into the BlueCloth directory. If you do have more than one version, you will need to add the version number to that.Once inside the BlueCloth directory, you will see a README and install.rb, first read the README. Hmmm… it is not real clear language, but it does indicate you will need to run install.rb. OK. In the same directory, run ruby install.rb and you should see a few lines:Cloth Installer Revision: 1.3 Testing for the StrScan library...foundTesting for the Devel-Logger library...foundInstalling If you get any error message, you either need to use sudo to do it, or you just do not have enough permissions/privileges on that machine. If you get no error message, then you can now use BlueCloth for converting Markdown to html!In any normal Ruby code, simply be sure to add:
require 'rubygems' In a Rails application, simply add the second require line in
require 'bluecloth'application.rb and you will be ok to use BlueCloth from within your Rails application. You can actually use both require lines there, but the require for rubygems is just taking up space on the page at this point. If Rails is working, then RubyGems has already been required somewhere else! The beautiful thing is, BlueCloth is easy to use and very effective! One more thing… this information is true on Linux, OS X, and any *NIX installation. On windows… I have no idea. Personally, I cannot see why people go through the pain of programming on windows, except that it can pay the bills…?
Entries Tagged 'Software' ↓
Ruby Gem BlueCloth not working? Not found? Not installed?
February 9th, 2008 — Beginning Programming, DreamHost, Goodbye Helicopter, Linux, OS X, Programming, Rails, Ruby, Software, UNIX, Vista, XHTML
SnapzProX2 : MacHeist : 2 days left!
January 21st, 2008 — Mac Rumors, OS X, Podcasting, Software
Only two days remaining on the MacHeist event for this year! Get it while the getting is good! It’s only $59 USD for the whole package of software and it’s worth that just for the wonderful app SnapzProX2, which I’ve wanted for years! That’s the app that you can use to create your own screencasts and video tutorials. The whole package is cheap. Best of all, the money goes to charity. You can even pick and choose the charity/charities from the list that you want your money to go to!!! How cool is that?!I think I’m going to be doing some serious screencasting in the coming future…
A Higher Level : What Ruby Represents
January 11th, 2008 — Beginning Programming, Books, Goodbye Helicopter, Perl, Programming, Ruby, Software
There is a pretty decent interview with Russ Olsen on his new book on design patterns in Ruby. In it he focuses on what is different and the same in Ruby design patterns. I’ve been thinking a lot about Ruby and what it represents, particularly when I’m (sadly) not working in Ruby.Mr. Olsen talks about how Rubyists just don’t bother with the factory patterns. As I understand it, the factory pattern has to do with object oriented classes that are called abstract classes and are developed as foundations for other classes. They’re then used to be sensible defaults that make descendent classes have lots of built-in goodness.Mr. Olsen wonders aloud why Rubyists don’t use them much. Well, it’s simple. Ruby itself has it built in for the most part. Ruby makes things clean enough that we don’t need to have our hands held and be told to stand in a straight line by somebody else most of the time. Sure, we make mistakes and duplicate things, but we can. And we can still make things work and get things done. Ruby also makes it a little bit pointless, since there are no truly private classes in Ruby. We can get at the core of anything and change it. There’s no company locking you in or limiting you with their private API. Ruby culture leverages the openness of the language as well as the old Perl attitude of “good enough for now, we can improve it later if needed.”

Ruby also represents a new level of abstraction from the machine. These days, processing speed and power are at a surplus in most situations. There will always be some need for high-performance, low-level programming, but even there, what was once done in assembly language is now done in C or C++ and will someday be done in better languages. (better for humans, that is) With Ruby and modern computers (which will only continue to improve) most of us don’t need to worry about mucking around with all that low-level crap. Quite honestly, we should not be worrying about that low-level stuff unless it truly is warranted. Ruby culture here too is about knowing that it may not be the fastest, but knowing that we can have a working solution fast and have fun doing it.Ruby gives you a chance to be concise and expressive, while still thinking in human terms more than with many other languages. Python is close to this as well, but not in exactly the same way. Interestingly, there doesn’t seem to be any real contention or rivalry between Ruby and Python, or Perl for that matter. They happily coexist as different ways of <em>getting things done</em>.Ruby does deserve all the buzz it’s getting. Believe me, programming often turned me off completely when I was younger, but not because I was younger, because it was more tedious than it needed to be. Programming should generally be about being lazy. Making a machine do things for you. Ruby makes it intelligible enough to wrap your head around what you are doing so that you <em>can</em> do it.I’ll admit, I like to do quick and dirty with Ruby as well as any old Perl programmer would do. Yes, I’m talking duct-tape and quick-drying super-glue. You can optimize and refine later. Get things done today!And by the way, you don’t have to learn design patterns first. Ruby will naturally get you using a lot of them without thinking, but if you find Ruby is your cup of tea, <em>you will want more…!</em>
Ruby, Apple, and the year 2008…
January 11th, 2008 — Goodbye Helicopter, Mac Rumors, OS X, Perl, Programming, Review, Ruby, Software, WordPress
It’s a bold new year for Ruby. The recent release of Ruby 1.9 (though it’s still not a production ready release), the inclusion of Ruby as an officially bundled item in OS X 10.5 (though 10.5 still needs a few dot-versions to reach production release itself), Rails 2.0, a whole plethora of new Ruby books…The Ruby year is going to be a good one. It may end up being a bit frustrating when the push to migrate to 1.9 actually does come, but shouldn’t be too bad.On the book side, there is a very interesting Ruby Design Patterns book as well as a few others, such as the Practical Ruby Projects book, and the FXRuby book.Now, we just need a RubyCocoa book, a Ruby Qt, a Ruby Tk, and a WxRuby book.We also need a Ruby game development book. I don’t have any interest in Lua, and Python is the Ruby for people who like the way Python does things.Myself, I’m working on a Cocoa wrapper app for RubyGems called Gem Commander. I’ve already got a proof of concept working app, but it’s slow going dealing with Cocoa and Objective-C after doing Ruby so much. Here is the logo for Gem Commander…
You see, Ruby is just so expressive and feels modern. Objective-C and Cocoa (and AppleScript, while we’re at it) all definitely show their age after coming from Ruby. The method signatures in Objective-C are conceptually very cool, and the whole thing beats the hell out of C++ or Visual Basic, but the naming of methods and the way things work is sometimes just not graceful at all. (especially, as I said, after doing things in Ruby)Even RubyCocoa is just a dog in comparison to straight Ruby. It does present the opportunity to mix good Ruby expressiveness in to things, but at the cost of still needing to navigate through Apple’s ridiculous documentation. Apple really really really could learn a lot about documentation in the modern world from the Rails crowd. (minus the people Zed Shaw bitches about… ).On the subject of Apple, AppleScript itself is really a dog these days and is overlooked or under-attended by developers. Apple really just needs to overhaul the whole damn thing in favor of serious Python, Perl and Ruby scriptability out-of-the-box. Then, you would see a real explosion of cool stuff.
New Mac Developer Podcast : Mac Developer RoundTable !
December 14th, 2007 — Beginning Programming, Goodbye Helicopter, Mac Rumors, OS X, Programming, Software, Web Graphics
Scotty is branching out and kind of bringing others on board… Late Night Cocoa is now part of the Mac Developer Network. But there’s more! A new podcast from Scotty, Mac Developer RoundTable is out and is as excellent as Late Night Cocoa, but with the different dynamic of multiple developers on together and interacting, sharing stories and bouncing ideas around! ( tune in for each episode to see what way they’ll geek out in the end when things start to break down at the end…)
Boris has also joined the Mac Developer Network, with his also great podcast, Cocoa Cast. Boris is also soon bringing us something new called Cocoa Cast Express.
And, if anybody is wondering where that very cool artwork for Late Night Cocoa, Mad Developer Roundtable and Cocoa Cast Express came from… me! So all of you developers out there, if you want some cool design work done for your application, you can always contact me and we can certainly work something out. And if you’re still reading at this point, rest assured, that my blog (you’re reading it now) is not the finest example of my artistic skills, but you may find some tidbits in here…
First Book With Rails 2.0 : The Rails Way
December 14th, 2007 — Beginning Programming, Books, Goodbye Helicopter, Programming, Rails, Ruby, Software, XHTML
The long awaited book “The Rails Way” is finally out, and it’s chock full of good stuff and even includes (slightly pre-release) coverage of Rails 2.0 already. Aside from the CD Baby boondoggle, Obie IS a Rails Core guy, ( I think… ) so he should know a thing or two about a thing or two.
The only drawback: the Rails Way is a big honker. Back breaker. The same problem with Hal Fulton’s classic “The Ruby Way”, the book is TOO BIG and heavy. I really wish publishers would get smart and publish these things in smaller volumes with numbers on the spine. It would be a lot easier to carry around and they’d quickly find out what parts of a text are really driving sales…
The Problem With Cocoa Programming
December 2nd, 2007 — Beginning Programming, Books, Mac Rumors, OS X, Programming, Ruby, Software
I’m a huge fan of Macs, no doubt about that. But… Cocoa programming leaves a lot to be desired at times. Continue reading →
News On “Cocoa Programming for Mac OS X” 3rd Edition !!!
December 1st, 2007 — Beginning Programming, Books, Mac Rumors, OS X, Programming, Software
For all those eager to learn Cocoa programming, yet stuck (blessed?) with 10.5 and Xcode 3, you know who you are… there is no way to run older versions usually. However, you can actually run Xcode 2.5 on Leopard! I know, I know, you want to use garbage collection, right? Well, it’s not the panacea you think it is for everything.
But for those who are still trying to learn using the Hillegass book with Xcode 3, this come from the proverbial horse’s mouth in a post to the Cocoa-Dev list:
From: Aaron Hillegass
Subject: Using “Cocoa Programming for Mac OS X” with Xcode 3.0
Friends,
I am getting some emails that go something like this:
“Hey! I just bought ‘Cocoa Programming for Mac OS X, 2nd Edition’ and
none of your directions work on Xcode 3. I hate you, I hate you, I
hate you.”
I understand your frustration, and I am sincerely sorry if you feel
that you have been cheated. The tools have changed a lot, and the
third edition won’t be ready for several more months. Let me point
out, however, that the frameworks themselves have changed very little
and the ideas in the book are still useful.
To use the 2nd edition with Xcode 3, you need to know how the new
tools are used. In particular:
1) You don’t create classes in Interface Builder any more. Create the
class in Xcode, and type in the outlets and actions.
2) You don’t have to explicitly reparse the .h files — Interface
Builder will automatically reparse the file every time it is saved.
3) Instead of control-dragging for every pointer IB, you control-click
on an object to get its connection panel, and drag from there.
To get comfortable with these changes, I suggest that you do Apple’s
tutorial before starting on my book:
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/
Skip my Palettes chapter! It is hopelessly out-of-date and unusable.
It will still require some patience to get through the book. If you
don’t have the patience, return the book to wherever you purchased it
– the new edition with Core Data, more Bindings, Web Services, View
Swapping, NSTask, Xcode 3, and Objective-C 2 will be available in the
Spring or early Summer.
Will I destroy my apology/helpful email with something crass and
commercial? I can not resist: I will be using a draft of the 3rd
edition of “Cocoa Programming for Mac OS X” at the Cocoa Bootcamp, Jan
14 - 18. If you want a seat, call 678-595-6773 to reserve one:
http://www.bignerdranch.com/classes/cocoa.shtml
We can send an instructor to your company, if that is more convenient/
cost-effective for you.
Also, Big Nerd Ranch will be running its first WebObjects course in
Germany, March 10 - 14:
http://www.bignerdranch.com/classes/webobjects.shtml
To register for that, call +49 (931) 9911-485.
Sincerely,
Aaron HIllegass
Big Nerd Ranch, Inc.
An Interesting Ruby One-Liner To Ponder
November 16th, 2007 — Beginning Programming, Programming, Ruby, Software
Here’s an interesting Ruby one-liner to ponder:
0.step(100, rand) { |x| puts x }
Imagine how useful this or some derivation of it could be in a game, or any situation where you want a timer, but not one that seems too regular and even…
10.4.11 Update is Smooth, Safari 3 Tiger is Grrrrreat!
November 15th, 2007 — OS X, Review, Software
The OS X 10.4.11 Update went smooth and seems to do what every Panther update did, fix bugs and make things peppier! And best of all, the Safari 3 inclusion is wonderful. It even improves on the beta. Big bookmarks menus are much more responsive than they’ve been in years. Finally!
Only thing missing is the magic widget button available in Leopard’s Safari 3…