How to freeze old rails gems

You probably came here wondering why

rake rails:freeze:edge RELEASE=2.3.2

doesn’t work, right? (It times out trying to pull the rails gem from http://dev.rubyonrails.org/archives/rails_2.3.2.zip)

Now you could try to hack the rake task in your rails gem

OR

- you could just go to rails github page https://github.com/rails/rails
- click on the ’switch tags’ button  and select the version of rails you’re looking for
- after the page reloads, click on download and select the ‘zip’ version
- download it to your ‘vendor’ directory in the rails app you’re trying to freeze rails to
- unzip the file and rename the directory to rails
- you’re done!

To make sure you’re running a vendored copy of rails you can just  put

<%= debug Rails.vendor_rails? %>

somewhere in one of your views, or run

Rails.vendor_rails?

from the console.
enjoy.

Add comment May 4th, 2011

How to get Ruby Native gems to install on your windows machine

The bane of any ruby/rails developer on a windows box (apart from piddling performance) is seeing the dreaded …
‘gem install error – ‘cl’ is not recognized as an internal or external command’

No more!
Devkit, a tool used by the folks who create the Windows Ruby Installer of each version of ruby helps you with (most) gems that need to be built natively.
Muchos Gracias to them for graciously providing it to us.

1 comment January 9th, 2011

How to install gems without ri and rdoc documentation on Windows

Installing gems is usually very quick on my computer … its the accompanying ri and rdoc installations that slows everything down to a crawl.
There’s an easy way to stop ri and rdoc installs on Windows.

All you have to do is go to
C:\Documents and Settings\All Users\Application Data\ on Windows XP
or
C:\ProgramData\ on Windows 7

create a file called gemrc

then put in the following
gem: --no-ri --no-rdoc

Hat tip to this Stack Overflow comment, give the man some more upvotes!

Add comment January 9th, 2011

Uploading a file using the simple_form rails gem

Simple Form is a rails gem that takes a lot of stress out of dealing with forms in Rails. Knowing what field nomenclature handles file uploading should be simple but its not. It took a lot of screwing around and reading the documentation to figure it out.

Simple Form uses the Provided Rails Form helpers so, if you want to specify a file upload field in Rails, just do this

<%= simple_form_for @user, :html => {:multipart => true}  do |f| %>
    <%= f.file_format :photo, :label => 'Your avatar please' %>
 <% end %>

Add comment December 9th, 2010

Adobe Acrobat Reader UI sends mixed messages?

Check this out.

Navigation for Adobe Reader 9

This is the UI for Adobe Reader that you use to Navigate through the pages in a PDF. Clicking the buttons move through the pages one at a time in each direction.

Guess what keyboard keys you have to use to navigate through the pages of the same PDF … the Left and Right Keys!

Very bad dissonance there, because the arrows keep making you think you should be hitting the up and down buttons to move through the pages.
Those icons should be left and right arrows to match the keyboard navigation and send a good visual cue to the user about what keys to hit. #dontmakemethink

Add comment November 26th, 2010

The 2 dumb mistakes Twitter made with its ipad app

The twitter app for the ipad is pretty darned spectacular, not just from a visual perspective, but specifically because of the brilliant UI choices they’ve made

However, there are two things that it/twitter does that are almost unbelievable.

Twitter app on the ipad

1. You cannot delete your tweets

No that’s not a typo.
You simply cannot delete a tweet you’ve made on the ipad app. If you make a mistake in one of your tweets, you’re SOL.

I understand getting a product to market fast, but leaving off a crucial feature, like deleting error ridden tweets, strikes me as a bit brain dead.
Its certainly a HUGE source of frustration for me … enough to keep searching for an alternative app.

2. You cannot access twitter.com from the ipad

I’m sure you’re saying “You whine too much dude. Just go to twitter.com and delete your tweet!”
Right?

Here’s the kicker …
You cannot access twitter.com from Safari browser on the iPad.

If you try to go to http://twitter.com you get this screen

twitter for the ipad splash screen

Very dumb, guys.
Please. Fix it.

PS: I lied … you can actually go to urls like http://twitter.com/concept47 … but thats about it, you can’t login or anything.

Add comment November 25th, 2010

How to turn off Length Error messages on Password Confirmation fields in Authlogic

In Authlogic, if you use a password confirmation field (when creating a new user perhaps), there is an error message that shows up for that field if the User model does not validate.
Something like

is too short (minimum is 4 characters)

Seems simple enough to turn off, but I almost went mad trying to figure out how do this without completely turning off password authentication.

class User < ActiveRecord::Base
    acts_as_authentic do |c|
         c.merge_validates_length_of_password_confirmation_field_options  :allow_blank => true
    end
end

PS: It’d be nice to get all the configuration options for Authlogic in one place, with better documentation for each one.
Maybe I should get on that … it is open source software after all

Add comment August 30th, 2010

Rails 3.0 is finally here

Put on your party hats people!
The long awaited version 3 of the Rails framework is finally here
Seems like only yesterday (2007/2008) that Rails 2 was being released, and now this. Frickin’ monumental.

PS: Rails 3 works with Ruby 1.8.7 and Ruby 1.9.2 … it segfaults with 1.9.1, so remember that when upgrading your ruby installation

rails 3.0 Released

Add comment August 29th, 2010

jQuery Deconstructed

Very cool visualization of the entire jQuery framework code

It visually breaks the code into sections/categories with short explanations of what each does.

Makes it really easy to follow and understand the jQuery code.

Built by UK Developer, Dave Stewart

visual-jquery-screenshot

Add comment July 23rd, 2010

Running thin instead of mongrel with script/server

Just go to the the rails directory that corresponds to this one on your computer (This is on a windows XP machine, but you should be able to figure out the right path on your machine)

C:\ruby\lib\ruby\gems\1.8\gems\rails-2.3.5\lib\commands

Open up server.rb

And edit the line that says

server = Rack::Handler::Mongrel

to say

server = Rack::Handler::Thin

enjoy

thin server logo

Add comment April 12th, 2010

In the midst of crisis, opportunity … a counter-argument to “Free Kills”

Today I read this really insightful article about how giving away software can kill the market for it.

While I largely agree with the Andy, I think that he has missed one important point.

Giving away a really good product in a certain space can depress sales and stifle innovation, but there will always be that small percentage of users whose needs are not met by the free alternative. Because of this, niche users will be willing to pay top dollar for a product that goes beyond the free alternative.

What about the free alternative?
Won’t its developers be adding features too?
Sure. They might.
But its free, so its not a priority.
Your customers, on the other hand, will pay you good money to make adding features they want a priority … see the difference?

Case in point, Google Calendar added to-do lists, almost a year ago now … but despite cries for an api for it, nothing has happened.
2524 users (people requesting that feature) is not a large number to google, but if you’re a small development shop … and each of those users were paying you  … say $4.99 a month … you’d be doing okay.
Lots of motivation to bang out an api … yeah?

So, instead of looking at it as “Free” killing the market for your product.
Look at it as  …. “Free” doing you the favor of hand delivering the most passionate, keyed-in, highly motivated group of users in the market for your product, to your doorstep … for free :D

You’re welcome.

Add comment February 9th, 2010

Google dropping support for IE6 in March 2010

Finally!

No_IE6

Add comment January 30th, 2010

How to add updated_at and created_at (timestamps) columns to an existing table in rails

From Rails Guides …

change_table :products do |t|
  t.timestamps
end

Add comment December 23rd, 2009

Google Chrome adds RSS feed notification/preview/subscription via extension

This may have been around for a while, but I just learned of it today.

If you run the dev version of Google Chrome, you may already be aware that it supports extensions.

In fact when I first found out Google had published a few extensions for eager beta testers to try out, I went and got the rss feed extension.

Unfortunately, even though it showed the icon when a feed was present, clicking it only took you to Google Reader to subscribe to the feed (or so I heard, clicking it in my version of Chrome did nothing)

Google Chrome RSS feed Extension feed availability notification

Google Chrome RSS feed Extension feed availability notification

I am happy to report that with the new version of this extension (1.6.2), clicking on a feed allows you to actually preview the rss feed …
<sound of angels singing HALLEJUYAH />

I can finally test rss feeds I’m coding in Chrome without having to fire up IE8 or Opera (Firefox doesn’t preview either, just tries to subscribe you to live bookmarks … I hate that) and unstar this bug ticket!

Image of Google Chrome RSS feed extension previewing a feed

Image of Google Chrome RSS feed extension previewing a feed

Add comment November 19th, 2009

Don’t hit the business growth accelerator just yet Joel!

Yesterday, Joel Spolsky posted an article about why growing steadily but slowly might not be such a good idea.

When I read it, I had my reservations about it, but I couldn’t express them … the whole idea just sounded wrong?

Well, the guys over at 37Signals issued a rebuttal of Mr Spolsky’s argument, and I have to say … I agree.

The main thing that drives the use of software like Fogz bugz (a bug tracking web application), is how good it is, and how much buzz it generates. The size of your company doesn’t matter if people that matter (developers in this case) are talking about the other guy’s software on twitter, facebook, digg or reddit, and recommending it to every other developer they can find.

Just my 2 cents.

cropper_capture_11-05-200911-05-14 AM

Add comment November 5th, 2009

Previous Posts


Feeds

Calendar

February 2012
S M T W T F S
« May    
 1234
567891011
12131415161718
19202122232425
26272829