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 'XHTML' ↓
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
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…
Tag Spam :: The Next Big Thing
October 3rd, 2007 — Beginning Programming, Blogs, CMS, JavaScript, MySQL, MySQL 5, PHP, Perl, Programming, Rails, Ruby, Software, Spam, Web Graphics, WordPress, XHTML
So, what’s the next big thing gonna be? TAG SPAM. That’s right Continue reading →
CSS-Based Rounded Corners Now
July 18th, 2007 — CSS, Web Graphics, XHTML
CSS3 is on the way and support is coming at a more rapid pace these days. Safar/WebKit/Konqueror/KHTML and Mozilla/Firefox are pushing the envelope big time.
IE7 probably doesn’t support it. Why would you expect that? And I can’t and don’t want to test IE anything anymore.
So without more ado, here’s the beef: Continue reading →
CSS3 Support: WestCiv is Ahead of The Game!
July 18th, 2007 — CSS, Software, Web Graphics, XHTML
The excellent WestCiv company, out of Australia, is ahead of the game as usual. They have an up-to-date list of CSS3 support. Glaringly lacking is a listing for Konqueror/KHTML, though arguably, it should have at least as much support as Safari 3 since both share the same WebKit code base.
Clearly, the WebKit group is working hard to implement CSS3 as we speak. This is no small undertaking and it explains why some sites are able to display things that I don’t expect to see, such as the appearance property for form buttons and menu-lists.
Way to go WestCiv! Keep up the good work.
Rails FormHelper Needs Some Help..?
July 17th, 2007 — FireFox 2, Programming, Rails, Ruby, XHTML
Rails includes a wonderful helper called FormHelper in ActionView::Helpers::FormHelper but… Continue reading →
Bruce Eckel Tries “Thinking in CSS”
July 16th, 2007 — Blogs, CSS, Programming, Web Graphics, XHTML
This article by Bruce Eckel, acclaimed author of Thinking in C++ and Thinking in Java, shows why programmers make bad designers. Continue reading →
Thoughts on BaseCamp
June 22nd, 2007 — CMS, Programming, Rails, Software, Web Graphics, WordPress, XHTML
I started working with some people recently who use BaseCamp. If you don’t know, BaseCamp is one of the pretty impressive things to come from the same people who created Rails. In fact, BaseCamp was one of the reasons for creating Rails to begin with.
Thus far, it’s pretty impressive. It’s responsive and feature-rich. It’s not terribly intuitive at first, but what project tracking/management application is intuitive? Name one. Can’t, can you? Regardless, the interface is pretty good. Similar in some regards to what you see in the WordPress dashboard, but a bit more thought-out.
I’m liking it, but it definitely takes a little getting used to.
Now, if only Google would come this close to good UI for Analytics (what a mess)!!
Ruby on Rails: Migrations Vs. SQL
May 12th, 2007 — Beginning Programming, Books, CSS, JavaScript, MySQL, MySQL 5, Rails, Ruby, Software, XHTML
So you’re learning or using Ruby on Rails, or even just using Ruby with a database. The ActiveRecord component of Rails provides one way to work with databases through Ruby. ActiveRecord applies a concept called ORM (Object Relational Mapping) to quite literally map object oriented programming constructs to relational database constructs.
What’s that mean? It means it you can write Ruby in a fairly Ruby way (to be fair to purists, a Rails way) when working with databases. Most folks will be using an SQL-based relational database, such as MySQL, PostreSQL or SQLite3. Others are possible, but MySQL is certainly the most common and probably best supported.
Specifically, Rails uses an approach called database migrations to substitute for writing SQL directly. Migrations make things pretty easy, indeed. You can learn plenty about using migrations with the main book for Rails, Agile Web Development With Rails. However, I encourage everyone to also take a look to the book, Ruby for Rails.
The general approach of Ruby for Rails is to get you to know how the magic works, and help you develop a better understanding of the underlying technology so you can do more with it. This is really a key thing. You’re not going to be good at Rails without learning Ruby itself, much less CSS, XHTML, and perhaps Javascript, and definitely a little SQL.
What?! Yeah. That’s right, you do need to know about the details. Perhaps not intimately, but well enough to understand what it is you’re really doing. SQL is a big subject. Lucky for you, database-driven web sites tend to do a lot of the same kinds of things in most situations. Therefore, you don’t need to be a master of SQL but you need to experience it and understand how it works. Particularly MySQL’s version (and if you’re a programmer, consider SQLite as well)
SQL isn’t that hard, but it is fairly different from most other programming languages. (yes, I think it IS a programming language.) But I don’t just want you to know SQL a little, I want you to know a little database design too. This is what is important so you will have some concept of what it is migrations is doing for you. When you have this in your head, you will then also know what migrations may not be able to do for you.
Google Analytics : AJAX Torture? Or Usability Joke?
May 11th, 2007 — CSS, JavaScript, Review, Software, Web Graphics, XHTML
Google Analytics was previously semi-useful as a web site traffic analysis tool. The previous incarnation was often confusing and had many non-intuitive mystery features coupled with terrible organization and absurdly missing features (delete an “account”? how?).
From a user standpoint it’s just gotten worse with the added AJAX. More pretty line graphs and distracting tool-tip style mouseOver events, less explanation of what the hell I’m seeing! To make matters worse, the stuff has been re-organized, or I should say, further disorganized in a truly Microsoft manner.
I guess Google really is actually in competition with Microsoft. Google makes a great search engine, but they make lousy interfaces. They made themselves famous with the orginal Google search engine page’s simplicity. But everything else they produce just seems to out-do Yahoo! and go head-to-head with Microsoft for making hard to use web sites. Only Adobe makes more difficult to use web sites, but they make them very pretty.
Apple. Oh, Apple… where for art thou?
When will AJAX just die? Only a few years ago JavaScript had gone away quietly to the graveyard of annoying technologies. Flash is/was on its way there. Now there is a renewed irrational exuberrance for all things overly animated.
Oh, and Google, my dear, the Beta forever thing is getting old. Keep it up and desperate SONY might sue for trademark infringement just to make some cash.