After beavering away on a Rails app for the last little while I wanted to put it up somewhere so the rest of the world can see it. I signed up with Heroku since they specialise in hosting Rails apps. Their database setup is kind of confusing. It turns out that they totally ignore your database configuration (database.yml is not used.) They just use the schema.rb to create the database that your app needs in their Postgres database. You just run your rake task to set it up. Thats pretty cool, but there is something cooler; can copy your entire local database with data and everything over to their server with the command:
heroku db:push
The only problem for me was that on Ubuntu (jaunty) the command failed telling me that I needed to intall Taps. More aggravating still was the fact that my attempt to install Taps also failed because its dependent on Sqlite3:
mike@jauntyjackalope:~$ sudo gem install taps
[sudo] password for mike:
Building native extensions. This could take a while…
ERROR: Error installing taps:
ERROR: Failed to build gem native extension./usr/bin/ruby1.8 extconf.rb install taps
checking for fdatasync() in -lrt… yes
checking for sqlite3.h… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/usr/bin/ruby1.8
–with-sqlite3-dir
–without-sqlite3-dir
–with-sqlite3-include
–without-sqlite3-include=${sqlite3-dir}/include
–with-sqlite3-lib
–without-sqlite3-lib=${sqlite3-dir}/lib
–with-rtlib
–without-rtlibGem files will remain installed in /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.5 for inspection.
Results logged to /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.5/ext/sqlite3_api/gem_make.out
This was pretty annoying. Worse still installing sqlite3 didn’t fix it. It took some googling to figure out what needed to be installed to make Taps and therefore Heroku happy. It turns out that sqlite.h lives in the package libsqlite3-dev:
mike@jauntyjackalope:~$ sudo aptitude install libsqlite3-dev
mike@jauntyjackalope:~$ sudo aptitude install libsqlite3-doc
mike@jauntyjackalope:~$ sudo gem install taps
Building native extensions. This could take a while…
Successfully installed sqlite3-ruby-1.2.5
Successfully installed taps-0.2.19
2 gems installed
mike@jauntyjackalope:~/dexterchief$ heroku db:push
Auto-detected local database
Sending schema
Sending data
6 tables, 53 records
comments: 100% |==========================================| Time: 00:00:01
posts: 100% |==========================================| Time: 00:00:01
roles: 100% |==========================================| Time: 00:00:00
roles_users: 100% |==========================================| Time: 00:00:00
schema_migrat: 100% |==========================================| Time: 00:00:01
users: 100% |==========================================| Time: 00:00:00
Sending indexes
Resetting sequences
Finally!






