views:

23

answers:

1

I want to setup different rails versions with RVM. However, working with the SQLite gives problem. First, doing

gem list -ra sqlite

gives

*** REMOTE GEMS ***

sqlite-foreigner (0.5.0)
sqlite-ruby (2.2.3 ruby mswin32, 2.2.2 ruby mswin32, 2.2.1 ruby mswin32, 2.2.0 ruby mswin32, 2.1.0 ruby mswin32, 2.0.3)
sqlite3 (0.1.1, 0.1.0, 0.0.8, 0.0.7, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1, 0.0.0)
sqlite3-dotnet (3.7.2.1, 3.7.2.0)
sqlite3-ironruby (0.1.1, 0.1.0)
sqlite3-ruby (1.3.1 ruby x86-mingw32 x86-mswin32-60, 1.3.0 ruby x86-mingw32 x86-mswin32-60, 1.2.5 ruby x86-mingw32 x86-mswin32, 1.2.4, 1.2.3 ruby mswin32 x86-mingw32, 1.2.2 ruby mswin32, 1.2.1 ruby mswin32, 1.2.0 ruby mswin32, 1.1.0 ruby mswin32, 1.0.1 ruby mswin32, 1.0.0 ruby mswin32, 0.9.0 ruby mswin32, 0.6.0, 0.5.0)
sqlitecache (0.0.1)

I am working with MacOS X 10.6, Sqlite3 3.7.2

Can I work with multiple versions of Sqlite3? What gems would I need in my RVM environment?

Currently:

*** LOCAL GEMS ***

actionmailer (2.2.3, 2.2.2)
actionpack (2.2.3, 2.2.2)
activerecord (2.2.3, 2.2.2)
activeresource (2.2.3, 2.2.2)
activesupport (2.2.3, 2.2.2)
ffi (0.6.3)
haml (2.2.0)
rails (2.2.3, 2.2.2)
rake (0.8.7)
ruby-openid (2.0.4)

And RVM list:

rvm rubies

   ree-1.8.6-20090610 [ x86_64 ]
=> ruby-1.8.6-p399 [ x86_64 ]
   ruby-1.9.2-p0 [ x86_64 ]
+1  A: 

you can install multiple sqlite3 packages simultaneously with gem. and you can select the specific gem version with the following lines:

require 'rubygems'
gem 'sqlite3', '=0.1.0'
require 'sqlite3'

To install it type:

gem install sqlite3 -v '0.1.0'

I think you can use any sqlite3 gem with any RVM, but you can check their webpage

KARASZI István
thanks for the helpful feedback. Do you know where/how to set the sqlite3 version in Rails?
poseid
Specify the sqlite3 version in your Gemfile. You'll only want to do this for :development and :test.
Tate Johnson
yes, in `config/environment.rb`, like this: `config.gem "sqlite3-ruby", :lib => "sqlite3", :version => '0.1.0'`
KARASZI István