我正在尝试将我的代码推送到Heroku,但是构建失败了
NameError: uninitialized constant Smtpapi
/tmp/build_0ce2a697c4ef6c16626b01b82d9463f3/app/helpers/my_mailer_header.rb:1:in `<top (required)>'
/tmp/build_0ce2a697c4ef6c16626b01b82d9463f3/lib/api_v1/users.rb:3:in `<top (required)>'
/tmp/build_0ce2a697c4ef6c16626b01b82d9463f3/lib/api_v1/mymedical.rb:3:in `<class:Mymedical>'
/tmp/build_0ce2a697c4ef6c16626b01b82d9463f3/lib/api_v1/mymedical.rb:1:in `<top (required)>'
/tmp/build_0ce2a697c4ef6c16626b01b82d9463f3/config/routes.rb:1:in `<top (required)>'
/tmp/build_0ce2a697c4ef6c16626b01b82d9463f3/vendor/bundle/ruby/2.4.0/gems/railties-4.2.11/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'我将我的Gemfile从Ruby 2.3更新到2.4,现在我得到了这个错误?找不到解决方案。
这似乎是导致问题的代码。
class MyMailerHeader < Smtpapi::HeaderSmtpapi在Ruby 2.4.2中不存在吗?
Smtpapi是Send-Grid gem和其他一些gem的一部分。
sendgrid-ruby (1.1.6)
faraday (~> 0.9)
mimemagic
smtpapi (~> 0.1)
smtpapi (0.1.0)发布于 2019-04-10 15:04:12
在1.x版本中,sendgrid-ruby仅依赖于smtpapi,包括当前的5.3.0在内的后续版本则不依赖。
由于这个错误与ruby更新一起出现--它可能是由于gem更新造成的。这应该已经被Gemfile.lock阻止了,但是如果Gemfile中包含任何窗口(mswin,mingw等)Heroku会忽略它。
gem本身已经4年没有更新了,因为sendgrid重写了sendgrid-ruby。最好的选择是跟随他们,并更新你的代码。但为了让应用程序在此之前运行--您可以显式锁定sendgrid-ruby:gem 'sendgrid-ruby', '~>1.1.6'的版本
https://stackoverflow.com/questions/54790356
复制相似问题