On Monday, August 28, 2017 at 1:45:49 PM UTC-4, [email protected] wrote: > > Sorry about that. It only occurred to me later that I should include the > code again. > > The current code is: > require 'sinatra/sequel' > require 'jdbc/mysql' > > DB = Sequel.connect('jdbc:mysql://dscheider@localhost/pelicans') > > migration "create teh pelicans table" do > DB.create_table :pelicans do > primary_key :id > text :name > integer :age > > index [:name, :age], :unique => true > end > end > > > class Pelican < Sequel::Model > end > > And the error I'm getting is: > Sequel::AdapterNotFound: LoadError: no such file to load -- sqlite3 > org/jruby/RubyKernel.java:961:in `require' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/adapters/sqlite.rb:1:in > > `<main>' > org/jruby/RubyKernel.java:961:in `require' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/core.rb:1:in > `block in (root)' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/core.rb:387:in > > `block in tsk_require' > org/jruby/ext/thread/Mutex.java:148:in `synchronize' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/core.rb:100:in > > `check_requiring_thread' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/core.rb:97:in > `check_requiring_thread' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/core.rb:387:in > > `tsk_require' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/database/connecting.rb:25:in > > `adapter_class' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/database/connecting.rb:55:in > > `connect' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sequel-3.46.0/lib/sequel/core.rb:147:in > > `connect' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sinatra-sequel-0.9.0/lib/sinatra/sequel.rb:21:in > > `database' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sinatra-sequel-0.9.0/lib/sinatra/sequel.rb:46:in > > `create_migrations_table' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sinatra-sequel-0.9.0/lib/sinatra/sequel.rb:34:in > > `block in migration' > > /Users/dscheider/.gem/jruby/2.3.3/gems/sinatra-1.4.2/lib/sinatra/base.rb:1915:in > > `<main>' > org/jruby/RubyKernel.java:961:in `require' > > /Users/dscheider/repos/ruby_agent_playground/kevin_marx_1/database.rb:6:in > `(root)' > uri:classloader:/jruby/kernel/kernel.rb:1:in `<main>' > org/jruby/RubyKernel.java:961:in `require' > uri:classloader:/jruby/kernel/kernel.rb:13:in `block in require_relative' > org/jruby/RubyBasicObject.java:1687:in `instance_eval' > /Users/dscheider/repos/ruby_agent_playground/kevin_marx_1/app.rb:3:in > `(root)' > /Users/dscheider/repos/ruby_agent_playground/kevin_marx_1/config.ru:1:in > `<eval>' > org/jruby/RubyKernel.java:1000:in `eval' > /Users/dscheider/repos/ruby_agent_playground/kevin_marx_1/config.ru:1:in > `new_from_string' > > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in > `initialize' > /Users/dscheider/repos/ruby_agent_playground/kevin_marx_1/config.ru:1:in > `new_from_string' > > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/lib/rack/builder.rb:49:in > `new_from_string' > > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/lib/rack/builder.rb:40:in > `parse_file' > > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/lib/rack/server.rb:277:in > `build_app_and_options_from_config' > > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/lib/rack/server.rb:199:in > `app' > > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/lib/rack/server.rb:314:in > `<main>' > org/jruby/RubyKernel.java:979:in `load' > > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/lib/rack/server.rb:250:in > `<main>' > org/jruby/RubyKernel.java:979:in `load' > > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/lib/rack/server.rb:141:in > `start' > /Users/dscheider/.gem/jruby/2.3.3/gems/rack-1.5.2/bin/rackup:4:in > `(root)' > /Users/dscheider/.gem/jruby/2.3.3/bin/rackup:1:in `(root)' > /Users/dscheider/.gem/jruby/2.3.3/bin/rackup:22:in `(root)' > > So what I don't understand is why sqlite3 is being required in the first > place, since it isn't in my Gemfile or Gemfile.lock. It looks like it's > being required for the Sequel sqlite adapter, but that code must only be > running because of something I'm doing, since this presumably doesn't > happen every time a project doesn't use sqlite3. > > You're encountering this line of code:
https://github.com/rtomayko/sinatra-sequel/blob/master/lib/sinatra/sequel.rb#L49 You can fix it by setting the DATABASE_URL environment variable to the same value you're using in your Sequel.connect method call. This isn't a Sequel error/bug, as Sequel is doing exactly as instructed. -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
