【问题标题】:Devise gem is adding Responders gem. How to remove it?设计 gem 正在添加响应者 gem。如何删除它?
【发布时间】:2015-01-22 18:43:31
【问题描述】:

这是我设计的 gemfile 信息:gem 'devise', branch: 'lm-rails-4-2'

我使用的是 Rails 4.2.0,捆绑后,每当我尝试搭建某些东西时,我都会得到这样的结果:

 respond_to :html

  def index
    @assets = Asset.all
    respond_with(@assets)
  end

这是因为响应者宝石。如何删除它?

使用 Ruby 2.1.2

【问题讨论】:

  • 如果设计依赖于它,则不能。顺便说一句,如果你在 Rails 4.2 中使用 respond_torespond_with,你必须添加响应者 gem。更多这里guides.rubyonrails.org/…
  • 但是当我使用较早版本的 Devise 时,它​​并没有使用它。另外,我认为我不需要添加响应者 gem,因为 Devise 已经为我添加了它。
  • 我在之前的评论中发布了一个链接,阅读其中的内容,您就会明白为什么。在 Rails 4.2 中,response_with 被移到了 responders gem 中,devise 使用了 respond_with,所以,responders gem 现在是 devise 的依赖项。没关系。

标签: ruby-on-rails ruby devise gem


【解决方案1】:

如果你想摆脱它并同时使用设计,那么你需要这样做:

  • 分叉设计
  • 从代码库中删除依赖项和对响应者的所有引用
  • github: "yourname/devise"链接你的项目gemfile中的fork

我真的不建议这样做。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-04
    • 1970-01-01
    • 2018-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多