Couldn’t find ‘rspec’ generator?

If you’ve moved on to Rails 3 and RSpec 2, but have older projects that are still on Rails 2.3 and RSpec 1.3.x, you may notice that script/generate no longer shows the RSpec generators in them, even if you’ve frozen the correct version of rspec and rspec-rails into vendor/gems.

I’m not sure of the proper place to report this bug, but a quickie workaround is to uninstall the newer rspec-rails gem so that 1.3.x is the newest in gem list.

Option-Click to Reposition Cursor in Terminal

I found this on SuperUser today and just have to share it.

In Terminal, you can reposition the cursor on a line by option-clicking where you want it to go. Credit where due.

It doesn’t happen every day, but certainly a few times a week: I end up with a monster command, spanning two full 100 character wide lines or more. Inevitably, there’s an error in there in the middle, and I sit waiting, holding down left-arrow to fix it and try again.

Bundler Simplified

Following up on my previous post about adapting pre-Bundler workflows to current best practices, Yehuda Katz posted his suggestions on how to approach Bundler in terms of what you used to do. It’s a good read.

One thing that caught me up was the deployment suggestion to require 'bundler/capistrano' in deploy.rb. If you installed Rails 3.0 soon after it was released, you may still have one of the Bundler 1.0 release candidates. I had RC3, and it didn’t include the Capistrano file, which led to a load error. Update your gem, and all will be well.

vendor/rails in the Age of Bundler

I’ve only followed the development of Rails 3.0 from a distance, mainly taking note of the major features and goals for the project and mostly ignoring all the little details that go into it. Once the 3.0 release candidate arrived, I started my next internal project with it and have been slowly coming up to speed on those little details. One that’s stymied me for a while is Bundler. Read More

My First Foray into Facebook Ads

Web Roulette hasn’t lit the world on fire. Thus far I’ve been working on free options: Twitter, Facebook and LinkedIn contacts, submissions to app review sites, giving out handfuls of promo codes and asking the younger members of my extended family to give them to their friends. It hasn’t made a noticeable difference. Thus far, sales have followed the usual “app curve”: the biggest sales day is day #1, with an almost exponential decline to one or two a day, at best. Read More

Adding “contrib” Extensions to MacPorts PostgreSQL

PostgreSQL is my database of choice. The main reason is that a standard distribution comes with just about everything one could ask for in a free RDBMS, and if what you want isn’t already installed, it’s often in the “contrib” directory. In particular, now that I’m doing a lot of iOS development, and location awareness is a big part of mobile apps, it’s useful to be able to work with coordinates. PostgreSQL does this using the cube data type and earthdistance functions, both in “contrib”. Read More

Web Roulette 1.0.1 is on the App Store

Apple approved the 1.0.1 update to Web Roulette earlier this week. It fixes a potential crash when submitting links back to us and addresses a UI glitch on the “about” screen.

One interesting statistic from the first couple weeks of sales is that iPad users are the large majority of daily users. It’s hard (impossible?) to say if this is because there is less competition in the iPad part of the App Store or if people prefer to use a web-centric app like Web Roulette on an iPad.

How to Set Up Internet Sharing on Mac OS X

These days, it’s not uncommon to be faced with the situation of having two or more Wi-Fi devices you might wish to use in a hotel room when the hotel does not provide free in-room Wi-Fi. The hotel doesn’t know that those devices are all yours and in one room, so using them means paying per device, which is crazy.

This explains how to easily set up Internet connection sharing in Mac OS X 10.6 so you can pay once, and piggyback the rest of your devices off that one laptop. These instructions assume that you have a wired Ethernet connection available in the room.

  1. Plug in your laptop to the Ethernet, pay and get it working.
  2. Go to System Preferences -> Network. Take note of the IP address, router and one DNS server.
  3. Ethernet connection settings

  4. There are three IP address ranges reserved for private use: 10.x.x.x, 172.{16-31}.x.x and 192.168.x.x. Looking at the IP address, router and DNS address from the previous step, pick one of those ranges that is unused. You’ll use this for the wireless network you create shortly. For example, the router is in 10.1.x.x and the DNS server is in 172.16.x.x, so I’ll use 192.168.x.x.
  5. You may find it easiest if you’re moving between locations to create a new network location for this Internet sharing configuration. You can do that in the Location drop-down at the top of the System Preferences window.
  6. Still in the Network part of System Preferences, choose AirPort, then click Advanced. Go to the TCP/IP tab.
  7. Pick any IP address in your chosen range, with a matching subnet mask. 10.x.x.x should use 255.0.0.0, 172.16.x.x should use 255.255.0.0, and 192.168.x.x should use 255.255.0.0. Enter the same router address you copied down from the Ethernet configuration. For this post, I’ll use 192.168.1.1.
  8. Wireless connection TCP/IP settings window

  9. Go to the System Preferences -> Sharing. Click the Internet Sharing item, but not the checkbox next to it. This should show “share your connection from” is Ethernet, and “to computers using” has AirPort checked. Click AirPort Options.
  10. Internet Sharing options dialog

  11. Pick a network name. I also recommend turning on 128-bit WEP. It’s not great, but it’s better than nothing. You need to pick a password, which unfortunately must be exactly 13 characters.
  12. Click the checkbox next to Internet Sharing and Start in the scary warning dialog that follows.
  13. From one of your other devices, you can now connect to your new wireless network. You will have to configure its IP address manually, since your Mac is not running a DHCP server to supply it.
  14. Use another, different address for your wireless device, but in the same network as the AirPort you just set up. Since it’s using 192.168.1.1, I’ll use 192.168.1.2. Use the same subnet mask, but use the AirPort’s IP (192.168.1.1) as the router. Use the DNS IP you copied down in step #2.
  15. an example of wireless network settings on an iPhone

That’s it: you should now be able to use the Internet from your wireless device, via your laptop plugged into the Ethernet.