Installing sqlite headers on ubuntu (sqlite3.h not found)
I was setting up Integrity for the first time and ran into this on my server when bundling gems:
~$ bundle install ... Installing do_sqlite3 (0.10.0) from rubygems repository at http://gemcutter.org/ with native extensions /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:482:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /usr/bin/ruby1.8 extconf.rb checking for sqlite3.h... no *** extconf.rb failed *** ...
The key is the line: checking for sqlite3.h... no
The do_sqlite3 gem gets compiled natively, but the development headers weren’t installed on the system and so the compilation won’t work.
Install them:
~$ sudo apt-get install sqlite3 ~$ sudo apt-get install libsqlite3-dev
Then, re-bundle:
~$ bundle install
Kansas City Ruby User Group: Kyle J Ginavan on Progressive Enhancement
Presentation: Kyle Ginivan on Progressive Enhancement
Progressive enhancement is a strategy for web design that emphasizes accessibility, semantic markup, and external stylesheet and scripting technologies. Progressive enhancement uses web technologies in a layered fashion that allows everyone to access the basic content and functionality of a web page, using any browser or Internet connection, while also providing those with better bandwidth or more advanced browser software an enhanced version of the page.
read more
Kansas City Ruby User Group: Shashank Date on Blocks, Procs, and Lambdas
Kansas City Ruby Users Group | February 2010 | Kyle J. Ginavan | Progressive Enhancement | kcrug.org from Wes Garrison on Vimeo.
Capistrano deploy error "fatal: unable to create '.git/index.lock': File exists"
This isn’t specific to capistrano, necessarily, but I ran into it deploying.
fatal: unable to create '.git/index.lock': File exists
read more
Announcing: Lowdown, a Cucumber feature editing webapp
An original application completed for Rails Rumble 2009.
Lowdown helps keep your development project on track by helping developers, designers, project managers and owners all focus on satisfying stakeholders.
Built along with Sean Cribbs + Scotty Moon + Paul du Coudray
While leading the competition after judges’ voting ended, we slipped to 4th place after public voting and ended up taking the “Best Appearance” category, which is fantastic.
Remove ERB files after upgrading to haml
I converted an application to haml and wanted to get rid of my previous ERb templates.
read more
Rails render partial counters: displaying a record's index in a collection
I always forget that you can reference the index of an item in a collection when you’re using a partial:
<%= render :partial => 'item', :object => @items %> # in _item.html.erb <%= item_counter %>
This is zero-based, so you might want to +1 if you want the count to start at 1.
It’s an easy way to number lines in a partial, which I find I do fairly often and I can never remember the syntax for getting that index counter!
Upgrading to Rails 2.3 with git
I upgraded an application to Rails 2.3, starting with making a new empty branch and using that merge back to a staging branch, which is very well described by Olly at the Bamboo Blog.
I had a few issues, which I thought I would collect here in case anyone else has them.
read more
Updating textarea with Ajax: unterminated string literal
If you try to update a textarea with newlines in it via Ajax, you may get an “Unterminated string literal” error. The update coming back may look like this:
$('textarea_to_update').value='line one
line two
line three';
This will fail because the javascript will interpret the newline as the end of the command.
So, replace those newlines with the newline character and the textarea will get updated correctly:
textarea_value.gsub!(/\n/, '\n')
TemplateError: wrong number of arguments in default_url_options()
During an app upgrade to Rails 2.2.2, I came across this error that baffled me for a few minutes:
ActionView::TemplateError
(wrong number of arguments (0 for 1)) on line #34
of app/views/account/_dashboard_header.rhtml:
34: <%= link_to 'My Dashboard', my_dashboard_url >
Checking out the backtrace:
(eval):3:in `default_url_options' (eval):3:in `my_dashboard_url' app/views/account/_dashboard_header.rhtml:34
Confusing. Why would this named route suddenly stop working? I did a search for default_url_options and found that I had overridden that function:
if production_mode?
def default_url_options()
{ :protocol => 'https://' }
end
end
Aha! Back in the day, default_url_options didn’t have any default options, so I wasn’t bothering to merge my desired options with the options parameter. I fixed it with a reverse_merge so any passed-in options would still exist.

Posted by Wes in
