Coffee-rails 和 rspec-rails 之间的 Gem 依赖冲突

发布于 2025-01-08 19:00:00 字数 478 浏览 1 评论 0原文

我正在将应用程序从 Rails 3.1.1 升级到 Rails 3.2。我必须将coffee-rails 和rspec-rails 的版本更新到最新版本才能与rails 3.2 一起使用。然而,他们俩似乎互不相容。当我运行bunder时,我得到

  In Gemfile:
coffee-rails (~> 3.2.2) ruby depends on
  actionpack (= 3.2.0) ruby

rspec-rails (~> 2.8.1) ruby depends on
  actionpack (3.0.0)

然而,在 rubygems for rspec-rails 上,它明确指定了依赖关系是 >= actionpack (3.0.0)

有人遇到过这个吗?

I'm upgrading an app from rails 3.1.1 to rails 3.2. I had to update version of coffee-rails as well as rspec-rails to their latest versions to work with rails 3.2. However, they both seem to be incompatible with each other. When I run the bunder I get

  In Gemfile:
coffee-rails (~> 3.2.2) ruby depends on
  actionpack (= 3.2.0) ruby

rspec-rails (~> 2.8.1) ruby depends on
  actionpack (3.0.0)

However, on rubygems for rspec-rails, it clearly specifies the dependency to be >= actionpack (3.0.0)

Has anybody faced this before?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对不⑦ 2025-01-15 19:00:00

我最近完成了这项工作,只是将来自全新 Rails 3.2 应用程序的资产组粘贴到 Gemifile 中:

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer'

  gem 'uglifier', '>= 1.0.3'
end

这不是一种完美的方法,但您可以删除当前的 Gemfile.lock 并将该应用程序捆绑为新应用程序。理论上听起来很脏,但在实践中效果很好。假设您正在使用 git diff,您总是可以看到差异。

I've done this recently just pasting in the Gemifile the asset group from a fresh new Rails 3.2 application:

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer'

  gem 'uglifier', '>= 1.0.3'
end

It's not a perfect way of doing it but you can remove your current Gemfile.lock and bundle the app as a new one. It sounds dirty in theory but it works just fine in practice. You can always see the differences with a git diff, supposing you're using it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文