ip2location / ip2proxy-ruby

Ruby library for IP2Proxy database lookup. It can be used to find the IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits.
http://www.ip2location.com
MIT License
13 stars 0 forks source link

Using ip2proxy-ruby gem with ip2location-ruby gem in one project #1

Closed durcak closed 7 years ago

durcak commented 7 years ago

Hi, I have problem with using ip2proxy-ruby gem with ip2location-ruby gem in one project, I get error: /usr/local/rvm/gems/ruby-2.3.0/gems/ip2proxy_ruby-1.0.1/lib/ip2proxy_ruby/database_config.rb:2: warning: already initialized constant DbConfig::COLUMNS /usr/local/rvm/gems/ruby-2.3.0/gems/ip2location_ruby-8.0.1/lib/ip2location_ruby/database_config.rb:2: warning: previous definition of COLUMNS was here or /usr/local/rvm/gems/ruby-2.3.0/gems/ip2proxy_ruby-1.0.1/lib/ip2proxy_ruby/database_config.rb:13:in block in setup_database': undefined method>' for nil:NilClass (NoMethodError) Can you help me with that please? Thanks

durcak commented 7 years ago

Hi I solve this problem with "require: false" in gemfile, but I have another problem: readbytes': data truncated. It looks like gems share their databases or data :/ Can you help me please? Thanks

/usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/io.rb:279:inreadbytes': data truncated (IOError) from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/string.rb:118:in read_and_return_value' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base_primitive.rb:127:indo_read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base.rb:147:in block in read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base.rb:254:instart_read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base.rb:145:in read' from /usr/local/rvm/gems/ruby-2.3.0/gems/ip2proxy_ruby-1.0.1/lib/ip2proxy_ruby/i2p_string_data.rb:11:inread_and_return_value' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base_primitive.rb:127:in do_read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/struct.rb:138:inblock in do_read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/struct.rb:138:in each' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/struct.rb:138:indo_read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base.rb:147:in block in read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base.rb:254:instart_read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base.rb:145:in read' from /usr/local/rvm/gems/ruby-2.3.0/gems/bindata-2.3.5/lib/bindata/base.rb:21:inread' from /usr/local/rvm/gems/ruby-2.3.0/gems/ip2proxy_ruby-1.0.1/lib/ip2proxy_ruby.rb:245:in bsearch' from /usr/local/rvm/gems/ruby-2.3.0/gems/ip2proxy_ruby-1.0.1/lib/ip2proxy_ruby.rb:74:inget_record' from /usr/local/rvm/gems/ruby-2.3.0/gems/ip2proxy_ruby-1.0.1/lib/ip2proxy_ruby.rb:192:in getAll' from /home/tomas/Plocha/Diplomka/ip2lite/proxy.rb:14:inblock (2 levels) in

' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/csv.rb:1748:in each' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/csv.rb:1131:inblock in foreach' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/csv.rb:1282:in open' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/csv.rb:1130:inforeach' from /home/tomas/Plocha/Diplomka/ip2lite/proxy.rb:12:in block in <main>' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/csv.rb:1282:inopen'`

ip2location commented 7 years ago

Hi @durcak We have updated our code to fix this issue.