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.
Thanks,
Dana
On Friday, August 25, 2017 at 5:56:22 PM UTC-7, Jeremy Evans wrote:
>
> On Friday, August 25, 2017 at 2:12:38 PM UTC-7, [email protected]
> <javascript:> wrote:
>>
>> When I make those changes I see this new error, indicating that sqlite3
>> can't be loaded. Not sure exactly what the issue would be there.
>>
>
> You can't load the sqlite3 library on JRuby, it requires a C extension.
> You need to use a URL that starts with jdbc. You didn't post the code you
> were using, so I can't provide a better recommendation.
>
> In the future, please only include in the text output, do not post a
> screenshot.
>
> Thanks,
> Jeremy
>
>
>
--
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.