StateOfZip
StateOfZip will return a state for a given zip code. It uses Sectional Center Facility locations to determine this. And then scrapes the data from en.wikipedia.org/wiki/ZIP_code_prefixes
Note some zip codes serve multiple states. This list may not be entirely accurate.
Compatibility
This is a Rails Engine and is only tested against Rails 3.2 and Ruby 1.9.3
Install
Add the following to your Gemfile
gem 'state-of-zip'
Then run
rake state_of_zip:install:migrations
Then run
rake db:migrate
Credit
The scraping script was taken from github.com/monicao/zip-code-info