user2116483
user2116483

Reputation: 21

- sequel/adapters/ (Sequel::AdapterNotFound)

I am trying to connect to an sqlite database using Sequel.connect(database_name) It returns the following error:

DEBUG OmlSqlSource: Connecting Sequel

/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': LoadError: cannot load such file -- sequel/adapters/ (Sequel::AdapterNotFound)

Upvotes: 2

Views: 6597

Answers (3)

kolen
kolen

Reputation: 2842

This error occurs if connection string is without adapter prefix, for example mydb.sqlite3 instead of sqlite://mydb.sqlite3.

I.e. when trying to run

sequel -m migrations development.sqlite

Instead of

sequel -m migrations sqlite://development.sqlite

Upvotes: 1

Andrew
Andrew

Reputation: 238617

I was getting a similar error, but it turned out that I need to include the sqlite3 gem in my Gemfile.

Also, I was using the wrong name for the adapter. I was using sqlite3 to match the gem name, but the name that Sequel expects is just sqlite.

Upvotes: 8

Jeremy Evans
Jeremy Evans

Reputation: 12139

You probably want Sequel.connect('sqlite:///path/to/database.sqlite') or Sequel.sqlite('/path/to/database.sqlite')

Upvotes: 1

Related Questions