I recommend that you use rvm
and bundler
to manage your gems and gem dependencies.
I never install any gems system-wide, specially on a Mac where it can get really messy dealing with system-wide gems.
It's easy to get rvm + bundler up and started.
First, install rvm (you must have git).
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
# this will be installed on your $HOME/.rvm directory
Setup rvm
echo "source $HOME/.rvm/scripts/rvm" >> $HOME/.bash_profile
source "$HOME/.rvm/scripts/rvm"
Then, install your ruby via rvm
rvm install ree # Ruby Enterprise Edition or,
# rvm install 1.9.2
# rvm install 1.8.7
Switch to your ruby compiler
rvm use ree
Create your gemset to easily switch to different gem versions.
rvm gemset create rails3 # where rails3 is the gemset name
Use your gemset
rvm use ree@rails3
Install bundler
gem install bundler # without sudo
Create a Gemfile and install your gems.
mkdir myproject
cd myproject
bundle init # this will create a Gemfile
echo "gem 'rails'" >> Gemfile
echo "gem 'sqlite3-ruby', :require => 'sqlite3'" >> Gemfile
bundle install
About your original post, if it's a system install, you can check it by running which sqlite3_ruby
and if it returns /usr/bin/sqlite3_ruby
then you should prepend sudo
to gem uninstall
command.