如何使Daterangepicker在Rails 6中工作?

问题描述 投票:0回答:1

我刚刚将我的Rails应用程序从v5.2.3升级到v6.0.0.beta3。我正在使用Daterangepicker v3.0.3 gem,它似乎与Rails 6.x不兼容。我的应用程序取决于宝石,我真的很想坚持下去,如果可能的话(怎么样?)如果没有,那么宝石会替代它?

我将Rails gem版本更改为edge并运行bundle更新。它输出以下内容:

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    jquery-datatables-rails (~> 3.4) was resolved to 3.4.0, which depends on
      actionpack (>= 3.1)

    rails (~> 6.0.0.beta3) was resolved to 6.0.0.beta3, which depends on
      actionpack (= 6.0.0.beta3)

Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    rails (~> 6.0.0.beta3) was resolved to 6.0.0.beta3, which depends on
      activemodel (= 6.0.0.beta3)

    web-console (>= 3.3.0) was resolved to 3.7.0, which depends on
      activemodel (>= 5.0)

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    friendly_id (~> 5.2.4) was resolved to 5.2.5, which depends on
      activerecord (>= 4.0.0)

    pg_search (~> 2.1, >= 2.1.5) was resolved to 2.1.5, which depends on
      activerecord (>= 4.2)

    rails (~> 6.0.0.beta3) was resolved to 6.0.0.beta3, which depends on
      activerecord (= 6.0.0.beta3)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    jbuilder (~> 2.5) was resolved to 2.8.0, which depends on
      activesupport (>= 4.2.0)

    pundit was resolved to 2.0.1, which depends on
      activesupport (>= 3.0.0)

    rails (~> 6.0.0.beta3) was resolved to 6.0.0.beta3, which depends on
      activesupport (= 6.0.0.beta3)

Bundler could not find compatible versions for gem "countries":
  In Gemfile:
    countries

    country_select (~> 3.1) was resolved to 3.1.1, which depends on
      countries (~> 2.0)

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    bootstrap-daterangepicker-rails (~> 3.0, >= 3.0.3) was resolved to 3.0.3, which depends on
      railties (>= 4.0, < 5.3)

    coffee-rails (~> 4.2) was resolved to 4.2.2, which depends on
      railties (>= 4.0.0)

    devise (~> 4.5) was resolved to 4.6.2, which depends on
      railties (>= 4.1.0, < 6.0)

    jquery-rails (~> 4.3, >= 4.3.3) was resolved to 4.3.3, which depends on
      railties (>= 4.2.0)

    momentjs-rails (~> 2.17, >= 2.17.1) was resolved to 2.20.1, which depends on
      railties (>= 3.1)

    rails (~> 6.0.0.beta3) was resolved to 6.0.0.beta3, which depends on
      railties (= 6.0.0.beta3)

    sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
      railties (>= 4.0.0, < 6)

    web-console (>= 3.3.0) was resolved to 3.7.0, which depends on
      railties (>= 5.0)

我注释掉了我的Daterangepicker gem和bundle更新工作完美无缺。我看到宝石取决于铁路<5.3,> = 4.0。 Rails v6使用栏杆> v4,这可能是它抛出错误的原因。我该怎么办?

先感谢您。

ruby-on-rails datepicker daterangepicker ruby-on-rails-6
1个回答
0
投票

值得注意的是,sass-rails也将railties版本锁定在< 6上。

如果这种情况发生了变化,我会感到惊讶,因为大多数Rails世界都会转向webpacker以获取前端的所有东西(曾经存在于资产管道中的所有东西)。值得看看像react-rails这样可以让你使用react-bootstrap-daterangepicker的东西。

或者你可以总是PR /叉Daterangepicker gem。虽然,基于提交频率和长期PR,我认为你可能会更好地运行webpacker路线。

© www.soinside.com 2019 - 2024. All rights reserved.