Entries Tagged 'Rails' ↓

CoreData - A Great Tutorial

If you think you are ready to sink your teeth into Core Data, you should definitely start with Scott Stevenson’s tutorial.

Granted, you may want to use XCode 2.x for the tutorial, since that is what the tutorial is in. The differences between Interface Builder with XCode 2.x and XCode 3.x are pretty huge. The workflow is very different. (not to mention the interface, no pun intended)

I myself am still getting acquainted with XCode 3.x and my new Intel-based MacBook is in the shop, so I’m on the reliable old G4 iBook today, so it is an exercise I can work on in the interim.

Although you don’t need to be an expert at Cocoa Bindings, and there’s a strong chance you’re not. (not many people are) You will want to at least have covered the frustration of trying to work with bindings a little bit before sticking your nose into Core Data. And, as always, I will say if you’ve worked with Ruby on Rails and Active Record before, you will find Cocoa, Cocoa Bindings and Core Data a little less frustrating, but don’t expect it to be the same thing. It does still work like ORM (object relational mapping) so having a basic understanding how CRUD (create, retrieve, update, destroy) applications work with databases will help you a lot.

Install Oniguruma on OS X !

You may have tried unsuccessfully to install the Ruby Gem ultraviolet or the gem it depends on, textpow, and if you did, it likely failed mysteriously. Well, you first need to download and install the Oniguruma regex library. These instructions should work on almost any *nix with GCC, as well as OS X 10.4 and 10.5 !First, go to  http://www.geocities.jp/kosako3/oniguruma/ and download the latest version of Oniguruma. (as of this writing, 5.9.1) In terminal, cd to the directory you downloaded the tarball to.Un-tar it: tar zxf onig-5.9.1.tar.gz Change to the directory of the un-tarred stuff:cd onig-5.9.1 Configure it, in most cases, just add the PATH you use, normally, /usr/local ./configure --prefix=/usr/local After that’s finished, sudo make and then,sudo make install
 Now, you can install that oniguruma gem with no trouble! Same goes for textpow and ultra edit. 

Ruby Gem BlueCloth not working? Not found? Not installed?

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'
require 'bluecloth'
 In a Rails application, simply add the second require line in 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…? 

First Book With Rails 2.0 : The Rails Way

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…

OS X 10.5.zero Leopard Opinion, Finalized

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

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 Leopard & Developers

Wow. Xcode and Leopard are going to be better! Xcode now apparently does PHP and Ruby and Rails in addition to XHTML and CSS. Let’s just hope they stole a lot of keyboard shortcuts from TextMate… Can’t wait to get my hands on this cat.
And, unlike Microsoft and Windows, it’s all freely included in OS X 10.5 Leopard !
How can anybody say that Macs are more expensive, when all the dev tools are free !?
I know Windows dev tools are anything but free, and no way they’ve ever been this cool.

One thing I’ve always wanted: syntax highlighting that actually shows scope!
Xcode 3 syntax highlighting is cool

Looks like Objective-C 2.0 has borrowed a bit from Ruby! Those Apple engineers, they just kick ass at making good stuff with end-users in mind.

Learn more at:
http://www.apple.com/macosx/developer/

Oh, and let’s hope that the inclusion of PHP and Ruby and Rails means that those tools will be updated regularly (or at least update-able ). After all, web software changes rapidly, and with the impending releases of Ruby 2.0 and Rails 2.0 in the next few months to a year, we can’t just have a one-time installation. We will need the ability to update gems and such.

Now all we can ask for is that Apple gets into making it better for developers who want to make games for the Mac. Investing in some game libraries (cross-platform…?) or even say Nintendo (the two companies would be soooo beautiful together…)…?

Tag Spam :: The Next Big Thing

So, what’s the next big thing gonna be? TAG SPAM. That’s right Continue reading →

OS X, suddenly: “No such file to load — rubygems (LoadError)” WTF?!

The dreaded “No such file to load — rubygems (LoadError)” came to me today. I recently installed some Python stuff, and I ran OS X Software Update. Either one could have been the culprit, but in this case it was the Python installation. Continue reading →

Rails on DreamHost: How to restart your app after a change…

If you, like me, and like so many countless people, host a Rails site on DreamHost, sometimes you need to make a tiny change to the code. (sometimes a BIG change…) But the changes don’t seem to take effect! Well, they how and why about that is pretty heady stuff I won’t go into here, but I will tell you how to restart your app the DreamHost way!
Continue reading →