【问题标题】:Impossible to run a Rails console on heroku with Attachinary: undefined method `respond_to' for Attachinary::CorsController:Class无法使用 Attachinary 在 Heroku 上运行 Rails 控制台:未定义方法 `respond_to' for Attachinary::CorsController:Class
【发布时间】:2016-12-19 16:22:07
【问题描述】:

我正在运行一个使用 Cloudinary/Attachinary 配置上传图像的 Rails 应用程序。在本地,一切都很好,我的应用程序运行,我可以将图片上传到 Cloudinary。我可以推送 Heroku,迁移正常,配置变量也可以,但应用程序因该错误而崩溃:

<class:CorsController>': undefined method `respond_to' for Attachinary::CorsController:Class (NoMethodError)

我们将不胜感激。

谢谢,

凯文

【问题讨论】:

标签: ruby-on-rails heroku cloudinary


【解决方案1】:

刚刚找到这个:How to include respond_to when you don't inherit from ApplicationController in Rails 4?,它解决了我的问题。

#Gemfile
gem 'responders'

然后

$ bundle install
$ rails g responders:install

【讨论】:

    猜你喜欢
    • 2016-11-30
    • 2018-06-04
    • 2015-05-11
    • 2016-06-29
    • 1970-01-01
    • 2020-06-03
    • 2015-06-20
    • 2012-02-15
    • 1970-01-01
    相关资源
    最近更新 更多