Archive for May, 2008

Things that suck about your MacBook Pro that no one will tell you about

I have a Core Duo model and am running windows (w/ bootcamp), so some of this stuff probably doesn’t apply but …

1. The hard drive is painfully slow. When you go to delete something, you can sit there for a good 5 seconds before the delete dialog is gone

2. You can only run an external 2.5 inch hard drive off one particular USB port (the one to the right) … if you put it on any other port, it will not get enough power and be stuck powering up then powering down. Or it will power up and stay fine for a bit, until it suddenly starts experiencing the situation I’ve described.

3. Maximum installable RAM … 2 Gigabytes.
god.

4. While you can get up to 4 hours of power running OS X on the battery … you’ll barely get 2 hours running Windows.

note: This is a late night rant … I love my darling MacBook Pro.

Add comment May 25th, 2008

Ruby on Rails gotcha: undefined method `rewrite’ for ….

undefined method `rewrite' for "":String

If you get this error, and the error message is pointing you to a “link_to” call or something similar, then you may be using an instance variable that’s called ‘@url’ too.

This blog post did talk about the problem but it seemed limited to models only. I finally discovered that, in my case, I was using ‘@url’ in the controller for the view where I was making the ‘link_to’ call.

Long story short, if you see this error, comb through your code (models, controllers and views) for any variables that are called ‘@url’  and change them.

Add comment May 16th, 2008

Dreamhost now supports mod_rails on their shared hosting plans

Dreamhost now supports the use of mod_rails on their shared hosting plans

The Phusion team contacted me with a working test version of Passenger a couple of months ago and since then DreamHost has been helping out with testing and ironing out lingering deployment issues.  The Phusion team has been very helpful and responsive throughout the process and I think we will see a lot more great things from them in the future.

Now to the important part… how do you use Passenger on DreamHost?

Briefly, all you do is enable the Ruby on Rails Passenger (mod_rails) option for any existing or new web domain in the DreamHost web control panel. When you then point that domain’s web directory to the public directory of an existing Ruby on Rails application it will work automatically.  For more detailed information, check out our Passenger wiki page.

Add comment May 14th, 2008

Bad system call … cygwin apache2/httpd2 error message …

I ran into a “bad system call” error while trying to run Apache2 on cygwin.

I had installed Apache 1.3 and Apache 2 using cyg-apt, but when I went to start the Apache 2 server, I kept getting this error.

apache2 on cygwin: Bad system call

Of course, I set off to fix this and after googling for a while, I found out that to fix the “bad system call” error you have to set the CYGWIN environment variable to ’server’.

The problem is, no one actually tells you one of two things

  • How to do it
  • That you have to have cygserver installed and running before hand.

First of all, set the CYGWIN environment variable.

Start by going to the root of your cygwin install and open cygwin.bat

root of cygwin install

Now insert this line in it

set CYGWIN=server

save the file and restart your cygwin shell (more information on setting the CYGWIN environment variable)

Now type cygserver-config and hit enter

cygserver-config

For me, that was enough (as you can see from the image above), but in case you need more help installing cygserver, here’s a link

After that, you just need to start the cygserver service like so

starting cygserver service

and now the command

httpd2 -k start

should work

httpd -k start finally works on cygwin

Apache2 on cygwin works!

1 comment May 8th, 2008

Safari on windows uses almost 500MB of Memory!!!

Insane!

Safari on windows uses almost 500MB of Memory!!!

Add comment May 3rd, 2008

php’s print_r equivalent in ruby on rails

I was going through my google analytics logs today and I noticed that a lot of folks were coming to my site on Google searches for stuff like ‘print_r + ruby on rails‘.

So I figured I’d write a blog post about it, because I’ve had the same problem.

What you’re looking for is ‘inspect’.

If you have an array, hash or object that you want to take a quick-and-dirty look at just type in

objectname.inspect

eg:

posts.inspect

or if you’re in rails just do …

render :text => posts.inspect and return false

and you’ll get an output of the contents of said array, hash or object.

Here is a screen capture of a quick irb session to show you how it works.

print_r equivalent in ruby on rails

I hope this helps.

Add comment May 1st, 2008


I recommend

Linode VPS's for Rails hosting
Heroku for mindless Rails hosting
Site 5 for shared Rails hosting and all round great service

Posts by Category

Calendar

May 2008
S M T W T F S
« Apr   Jun »
 123
45678910
11121314151617
18192021222324
25262728293031

Posts by Month