mime-types/ruby-mime-types

Does an old version on mime-types have to depend on mime-types-data gem?

kirillzhiganov opened this issue · 5 comments

Hi,

We have to stick to an old ruby version (1.8.xx) due to some chef dependencies in the project.

While trying to install rest-client gem (1.6.7) we have to install mime-types (we use 1.17.2) and recently it begun demanding mime-types-data gem, which cannot be installed on our ruby version.

As far as I understand it, when using mime-types gem version 1.17.2 there shouldn't be any dependency on the new gem mime-types-data.

For us installation fails because an unnecessary gem (mime-types-data) is included as dependency for mime-types.

Can it be fixed or avoided somehow?

Thank you in advance

  • install version 1.17.2 of package mime-types
    * gem_package[rest-client] action install[2016-01-14T15:03:41+01:00] INFO: Processing gem_package[rest-client] action install (line 14)

       ================================================================================
       Error executing action `install` on resource 'gem_package[rest-client]'
       ================================================================================
    
       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '1'
       ---- Begin output of /usr/bin/gem install rest-client -q --no-rdoc --no-ri -v "1.6.7" ----
       STDOUT: 
       STDERR: ERROR:  Error installing rest-client:
        mime-types-data requires Ruby version >= 2.0.
       ---- End output of /usr/bin/gem install rest-client -q --no-rdoc --no-ri -v "1.6.7" ----
       Ran /usr/bin/gem install rest-client -q --no-rdoc --no-ri -v "1.6.7" returned 1
    
       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cookbooks/project/recipes/_ruby.rb
    
        14: gem_package "rest-client" do
        15:   version "1.6.7"
        16: end
        17: 
    
       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cookbooks/project/recipes/_ruby.rb:14:in `from_file'
    
       gem_package("rest-client") do
         provider Chef::Provider::Package::Rubygems
         action :install
         retries 0
         retry_delay 2
         guard_interpreter :default
         package_name "rest-client"
         version "1.6.7"
         timeout 900
         cookbook_name :"prefill-system-test"
         recipe_name "_ruby"
         gem_binary "/usr/bin/gem"
       end
    

mime-types 1.x has not been updated in several years and is no longer supported. There is absolutely no dependency on mime-types-data introduced. The dependency issue you are experiencing is because your install of rest-client is not finding an installed version of mime-types that matches its requirements.

My primary recommendation is to figure out how to upgrade to a supported version of Ruby (Ruby 1.8.7 was EOLed several years ago, and even Ruby 2.0 is hitting EOL next month).

I don’t use Chef, so I don’t know how to resolve this problem, but I would suggest that you consider having a gem_package clause the first installs a mime-types version that your system supports.

mime-types version 1.17.2 was installed just before rest-client installation called. You could see it in my second comment where I put the log. And according to rest-client gem description version 1.6.7 demands mime-type version >=1.15

But still it goes for mime-types-data.

Unfortunately, I cannot help you as the problem is not in mime-types. This is, as far as I can tell, a problem with Chef and/or an older version of RubyGems on an unsupported version of Ruby. mime-types 1.17.2 was released in October 2011; the last ever version of mime-types 1 was released in November 2013. The dependencies for mime-types 1.x has not changed in that time period.

Ok, thank you for trying. We will look for a solution