kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

Can't install binary package from a gem server #154

Closed guss77 closed 3 years ago

guss77 commented 7 years ago

I've build a binary gem for Linux as per the instructions under docs, and published it to a fury.io repository. But when I try to install the binary gem, gem for some reason prefers to download the source only version from rubygems.org.

Here is the output of a run under --debug --verbose:

# gem install --debug --verbose --platform x86_64-linux --source https://secret-code@gem.fury.io/guss77/ ruby-oci8
Cleaning up installed gems...
Clean Up Complete
NOTE:  Debugging mode prints all exceptions even when rescued
Exception `LoadError' at /opt/rh/rh-ruby23/root/usr/share/ruby/resolv.rb:171 - LoadError
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
Exception `Resolv::ResolvError' at /opt/rh/rh-ruby23/root/usr/share/ruby/resolv.rb:494 - DNS result has no information for _rubygems._tcp.gem.fury.io
Getting SRV record failed: DNS result has no information for _rubygems._tcp.gem.fury.io
HEAD https://secret-code@gem.fury.io/guss77/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=ruby-oci8
200 OK
GET https://secret-code@gem.fury.io/guss77/api/v1/dependencies?gems=ruby-oci8
200 OK
Exception `Resolv::ResolvError' at /opt/rh/rh-ruby23/root/usr/share/ruby/resolv.rb:494 - DNS result has no information for _rubygems._tcp.gem.fury.io
Getting SRV record failed: DNS result has no information for _rubygems._tcp.gem.fury.io
GET https://secret-code@gem.fury.io/guss77/quick/Marshal.4.8/ruby-oci8-2.2.3-x86_64-linux.gemspec.rz
200 OK
Exception `Errno::EEXIST' at /opt/rh/rh-ruby23/root/usr/share/ruby/fileutils.rb:253 - File exists @ dir_s_mkdir - /root/.gem/specs/gem.fury.io%443/guss77/quick/Marshal.4.8
Exception `Resolv::DNS::Config::NXDomain' at /opt/rh/rh-ruby23/root/usr/share/ruby/resolv.rb:549 - _rubygems._tcp.api.rubygems.org
Exception `Resolv::DNS::Config::NXDomain' at /opt/rh/rh-ruby23/root/usr/share/ruby/resolv.rb:549 - _rubygems._tcp.api.rubygems.org.local.geek.co.il
Exception `Resolv::DNS::Config::NXDomain' at /opt/rh/rh-ruby23/root/usr/share/ruby/resolv.rb:549 - _rubygems._tcp.api.rubygems.org.geek.co.il
Exception `Resolv::ResolvError' at /opt/rh/rh-ruby23/root/usr/share/ruby/resolv.rb:494 - DNS result has no information for _rubygems._tcp.api.rubygems.org
Getting SRV record failed: DNS result has no information for _rubygems._tcp.api.rubygems.org
GET https://api.rubygems.org/quick/Marshal.4.8/ruby-oci8-2.2.3.gemspec.rz
200 OK
Exception `Errno::EEXIST' at /opt/rh/rh-ruby23/root/usr/share/ruby/fileutils.rb:253 - File exists @ dir_s_mkdir - /root/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8
Downloading gem ruby-oci8-2.2.3.gem
Exception `Errno::ENOENT' at /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/remote_fetcher.rb:316 - No such file or directory @ rb_file_s_stat - /opt/rh/rh-ruby23/root/usr/local/share/gems/cache/ruby-oci8-2.2.3.gem
GET https://api.rubygems.org/gems/ruby-oci8-2.2.3.gem
Fetching: ruby-oci8-2.2.3.gem (100%)
200 OK

Can you please help with understanding why the binary package is not being downloaded?

Best regards.

kubo commented 7 years ago

What version of ruby do you use to create the binary gem? What version of ruby do you use to install the binary gem from fury.io? Could you install the binary gem on local?

# Copy ruby-oci8-2.2.3-x86_64-linux.gem to the current directory in advance.
$ gem install ./ruby-oci8-2.2.3-x86_64-linux.gem

If you get the following error, it is same issue with #155. You need to fix ruby-oci8.gemspec as 1aa55dab5b51c5337d33cdd428bc024ce73f9ff4.

ERROR:  Error installing ./ruby-oci8-2.2.3-x86_64-linux.gem:
    ruby-oci8 requires Ruby version ~> 2.3.0.0.
guss77 commented 7 years ago

The gem was built using Ruby 2.3.1 on CentOS 7 using SCL rh-ruby23 installation. Then a similar machine (an image with the same setting but without development packages) was used to install the resulting binary. All testing was done using Docker.

Downloading and installing manually works fine.

If I build the gem from the new branch, I still get gem downloading the non-binary version.

kubo commented 7 years ago

IMO, this isn't a ruby-oci8 issue as long as you can install the binary gem on local file system. It looks like an installation issue of fury.io. Well, could you check gemspec file in the fury.io gem server?

  1. Save the following code as dump_gemspec_rz.rb.
    
    require 'open-uri'
    require 'zlib'

rz_data = open(ARGV[0]).read serialized_obj = Zlib::inflate(rz_data) spec = Marshal::load(serialized_obj) puts spec.to_yaml

2. Run the followings. (Fix `secret-code` in advance)
```shell
$ ruby --version # just for confirmation
$ ruby dump_gemspec_rz.rb https://secret-code@gem.fury.io/guss77/quick/Marshal.4.8/ruby-oci8-2.2.3-x86_64-linux.gemspec.rz