I figured it out.  It was this in patron on the main file lib/
patron.rb

cwd = Pathname(__FILE__).dirname
$:.unshift(cwd) unless $:.include?(cwd) || $:.include?
(cwd.expand_path)


On Sep 14, 3:22 pm, dusty <[email protected]> wrote:
> I am working on a project and have a gem that uses Patron for http
> sessions (http://toland.github.com/patron/).  I have run into an issue
> where if I require patron in the project, I cannot connect to the
> database with sequel.
>
> Here is an example:
>
> This works:
> require 'mysql'
> require 'sequel'
> DB = Sequel.connect('mysql://r...@localhost/test123')
>
> When I simply include patron, I get an error
> require 'patron'
> require 'mysql'
> require 'sequel'
> DB = Sequel.connect('mysql://r...@localhost/test123')
>
> /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/sequel/
> core.rb:184:in `require': can't convert Pathname into String
> (TypeError)
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel/core.rb:184:in `block in require'
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel/core.rb:184:in `each'
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel/core.rb:184:in `require'
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel/core.rb:335:in `<module:Sequel>'
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel/core.rb:61:in `<top (required)>'
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel/model.rb:1:in `require'
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel/model.rb:1:in `<top (required)>'
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel.rb:1:in `require'
>         from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/sequel-3.4.0/lib/
> sequel.rb:1:in `<top (required)>'
>         from test.rb:3:in `require'
>         from test.rb:3:in `<main>'
>
> I looked through the patron code and I couldn't spot anything that was
> overriding core classes or doing anything interesting.
>
> I did see that patron requires, pathname, but if I remove the require
> 'patron' and replace that with require 'pathname', it works fine.
>
> Does anyone have any suggestions on where I can look to figure this
> one out?
>
> -Dusty
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to