Diego81 / omnicontacts

A generalized Rack middleware for importing contacts from major email providers.
477 stars 230 forks source link

omnicontacts errors with rack 2 (after upgrading to rails 5) #163

Closed joshtobin closed 7 years ago

joshtobin commented 8 years ago

this is the error I get: undefined method `include?' for nil:NilClass

on line 26 of omnicontacts (0.3.7) lib/omnicontacts/builder.rb @ins << @app unless rack14? || @ins.include?(@app)

so it seems to me the rack14? method should be improved as it now needs to recognise the new major version. I think what it is really looking for is if the version is over 1.3.

If I edit the function to be as below, then it works.

   def rack14?
      v = Rack.release.split('.')
      v[0].to_i >= 1 || v[1].to_i >= 4
    end
teodor2903 commented 8 years ago

Thanks!

rolme commented 8 years ago

This also fixed my issue. Sent PR #164 based on this suggestion.

hugoh59 commented 7 years ago

This problem is not resolved I still have the same issue...

sudhirsb2003 commented 6 years ago

i am also getting the above error, did anyone get through the error?