-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange issue with 3.1, background jobs, Heroku and HTML email attachments (#117) #127
Comments
… That‘s really weird. It’s pointed out something that I didn’t know ( |
I'm hitting this trying to update this code from mime-types 2.6.2 to 3.1 with ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]. Will update if I find more info. Stacktrace:
Repro:
git clone https://github.com/johnsonj/cloud_controller_ng
cd cloud_controller_ng
sudo -u postgres psql -c "create user pguser with password 'pguser' superuser;"
sudo -u postgres psql -c "create database cc_test;"
DB=postgres PGPASSWORD="pguser" PGUSER="pguser" bundle exec rspec spec/unit/controllers/runtime/buildpacks_controller_spec.rb |
+1 |
In our case the issue isn't that @extensions_index is nil, it's that we were passing in a bad parameter that it was previously quiet about. The calling code essentially did this: MIME::Types.of(Tempfile.new).first.try(:content_type) Which is used to create an empty array inside of type_for a = Array(Tempfile.new) # => []
a.flat_map { |fn| puts 'never called!'; fn } # => []
a.compact # => []
a.inject(:+) # => nil So ruby learnings from this bug:
|
Highlighted by this issue: mime-types/ruby-mime-types#127 (comment) Suggested fix by: @Gerg
This is because Sounds like I might need to go back to |
Highlighted by this issue: mime-types/ruby-mime-types#127 (comment) Suggested fix by: @Gerg
Highlighted by this issue: mime-types/ruby-mime-types#127 (comment) Suggested fix by: @Gerg
Resolved with edf3cd7. |
This seems to have re-occurred in rails 5.0.2, ruby 2.4.0
mime_types version 3.1
calling MIME::Types.of(filename) causes an error: undefined method
sort' for nil:NilClass /app/vendor/bundle/ruby/2.4.0/gems/mime-types-3.1/lib/mime/types.rb:152:in
type_for'/app/vendor/bundle/ruby/2.4.0/gems/mime-types-3.1/lib/mime/types/registry.rb:32:in `type_for'
filename is some_name.pdf and is definitely present at this point
This works locally including in a local delayed job but on heroku worker in a delayed job I get this error which seems like issue 117
NB dj running as a daemon
The text was updated successfully, but these errors were encountered: