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 'OS X' ↓
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…
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…
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.
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…
OS X 10.5.zero Leopard Opinion, Finalized
November 12th, 2007 — Goodbye Helicopter, Mac Rumors, OS X, Rails, Review, Ruby, Software, UNIX
Well, I gave Leopard a day; One whole day of mostly lost time trying to get things working for developing again. Granted, Continue reading →
OS X 10.5 Leopard, Ruby and Rails, almost
November 10th, 2007 — MySQL, OS X, Programming, Rails, Review, Ruby, Software, UNIX
Well, OS X now comes a lot closer to having a good Ruby and Rails, but I don’t like it.
What’s the deal with giving a default Rails DB configuration using SQLite3?!!
Lame. Sorry. Most folks doing Rails work use MySQL…
And as for the gems installed… uh where is Rmagick? Why isn’t Image Magick installed? X11 is now installed by default, so it only stands to reason…
Nice try guys, but unless this is Ruby and Rails for Apple’s internal use, there’s not much point. I expect to see a one-click replacement soon, but I’m going to go back and hook up my old installation the Hivelogic way. It just works better and corresponds better to what’s available on real-world hosting providers.
The gem choices are somewhat odd. Limited and odd. I’m dumping it and going with my own. Apple, (Laurent) I will leave yours in /usr/bin but I will not use it. Thanks anyway.
OS X 10.5 Leopard, First Impressions
November 10th, 2007 — OS X
I just installed OS X 10.5 Leopard on my aging workhorse iBook G4 14-inch. Here are my observations thus far: Continue reading →