Archive for the ‘Tips’ Category
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Upgrading to the latest RubyGems in Ubuntu Gutsy is a bit non-straightforward. I’d like to share a quick fix this time. It’s trivial when you know it, but if not, a friend of mine has almost hosed his system just because of this annoying “bug”.
Installing Ruby in Ubuntu is pretty simple:
sudo aptitude install ruby ri irb rdoc rubygems libruby-extras libmysql-ruby ruby1.8-dev
(add other packages as you see fit)
The problem occurs right after you upgrade RubyGems to the latest version:
Author: ceefour | Filed under: Beginner, Complaints, Ruby, Tips, Tools, Tutorials
Tags: error, fix, gem, gems, gutsy, installation, rubygems.ruby, troubleshooting, tutorial, ubuntu, update, upgrade
Recently I got a task which involves moving, or let’s say copying, an entire Subversion repository with history to another server. Problem is, I didn’t have access to the server itself, which means I couldn’t do a regular “svnadmin dump”.
SVK comes to the rescue!

To make it work, first of all you need to install SVK. In Ubuntu it goes like this:
sudo aptitude install svk
When you first run svk it’ll ask you to create a local depot, you can simply agree to its suggestion.
Author: ceefour | Filed under: Cool, Opinions, Tips, Tools, Tutorials
Tags: dump, export, import, load, migrate, migration, repository, subversion, svk
I’d like to express a warm notice that AdaRuby.com might be down intermittently as we’ll be having major rearrangement and server upgrades of our hosting facilities in the coming days.

The upside is, when it’s done (and oh YES it will be done!), I’ll be providing you interesting information on the stuff that we’re doing, especially our experience regarding the hosting services that we have been using all this time.
Looking forward to hearing you share your experience as well!
Author: ceefour | Filed under: News, Opinions, Rails, Rails Hosting, Tips
Tags: 305, 317, 321, 324, 328, 335, 355, 356
Design Patterns in Ruby documents smart ways to resolve many problems that Ruby developers commonly encounter. Addison-Wesley Professional press has this exciting book, authored by Russ Olsen.
Russ Olsen has done a great job of selecting classic patterns and augmenting these with newer patterns that have special relevance for Ruby. Most design pattern books are based on C++ and Java. But Ruby is different—and the language’s unique qualities make design patterns easier to implement and use.
Tags: 299, 308, 309, 318, 319, 343
A common stumbling block for beginner Rails developers is learning the basics required to write plugins. This is made more complicated by the fact that Ruby is inherently dynamic and offers many techniques for code reuse.
Luckily, if you can write Rails applications you can write plugins by simply drawing on a handful of basic patterns.
Why write plugins?
Writing a plugin will:
- Help make sharing code more efficient, whether it’s between projects or within the same project
- Allow you to publish generic code to the community
- Save time and increase your confidence by testing once and reusing many times
Author: ceefour | Filed under: Beginner, Plugins, Rails, Tips, Tools, Tutorials
Tags: 294, 296, 344
Practical Reporting with Ruby and Rails is a great book for Ruby and Rails developers seeking to create compelling business intelligence and reporting solutions using a wide variety of applications and services. Published by Apress, and the author is David Berube.
Business intelligence and real-time reporting mechanisms play a major role in any of today’s forward-looking business plans. With many of these solutions being moved to the Web, the popular Rails framework and its underlying Ruby language are playing a major role alongside web services in building the reporting solutions of tomorrow.
Tags: 282, 296, 299, 312, 347, 348, 349, 40
As easy as:
has_timezone :fields => [ :start_datetime, :end_datetime]
Timezone_fu makes it really easy to deal with datetime fields in your models. It adds a method to your models, has_timezone.
The README for the plugin describes all of the options but below is an example:
class Event < ActiveRecord::Base
has_timezone :fields => [ :start_datetime, :end_datetime]
end
The model has three fields a start_datetime and end_datetime and a timezone. Adding has_timezone to the model changes the behavior of the two datetime attributes.
Notice below that calling event.start_datetime shows the time in local time (”America/New York”).
Author: ceefour | Filed under: Cool, Plugins, Rails, Ruby, Tips, Tools, Web 2.0
Tags: 296, 299, 315, 316, 344, 361, 362, 363
You know what, I really wanna learn this whole JavaEE-related thingy……
For some reason it’s unavoidable……. it’s bound to be touched by me……

You see, the trend is going RIA. MVC is going away. AJAX ain’t gonna compete. At least not fully. And will lose in many ways in respect to something like Adobe’s Flex. (Unfortunately there’s not much competitor better than Flex, and fortunately it’d probably be “standard” in the near future). Esp. with Flex going open source. Flex will need a backend, since it’s not a server-side product. There is Flex LiveCycle Data Services ES (what a name!!) by Adobe. There’s also BlazeDS open source. There’s also the excellent WebORB, which is free and open source for Rails and PHP. Oh yeah, it’s free for Rails!
Author: ceefour | Filed under: Ajax, Cool, Enterprise, JRuby, Opinions, Praises, Rails, Ruby, Tips, Tools, Web 2.0
Tags: 286, 291, 299, 309, 311, 322, 325, 327, 330, 331, 332, 333, 350, 351, 353, 358, 366, 368
The goal of Portable Ruby is to reduce those updates to a single place, your USB drive. About.com describes how to make this possible:
Installing Ruby
The easiest way to setup a Portable Ruby application is to start with an existing Ruby installation. I recommend the One-Click Installer. If you haven’t done so already, go ahead and install it.
The entire Ruby distribution is created in a single “ruby” directory structure. Additional changes include the creation of shortcuts for the start menu, which we will simulate in the PortableApp menu. The One-Click Installer also updates the Windows PATH environment variable to include the ruby\bin directory.
Author: ceefour | Filed under: Cool, Reviews, Ruby, Tips, Tools, Tutorials
Tags: 299, 300, 320, 323, 338, 345, 346
The latest entry in Addison-Wesley’s Professional Ruby Series is The Rails Way, by Obie Fernandez, is a long awaited book billing itself as the “expert guide to building Ruby on Rails applications.”
More precisely, the book dives into nearly every area of the Rails libraries and APIs and acts as a reference work for them. Coming in at about 850 pages, the book is physically very similar to The Ruby Way by Hal Fulton. There’s no denying that these two books look good next to each other on the bookshelf, and a lot of comparison can be made between the two.
Author: ceefour | Filed under: Books, Cool, News, Praises, Rails, Reviews, Tips, Web 2.0
Tags: 296, 302, 310, 342, 351, 360