Rails 3 / Cucumber问题:“...已经激活构建器3.0.0,但您的Gemfile需要构建器2.1.2” [英] Rails 3/Cucumber problem: "...already activated builder 3.0.0, but your Gemfile requires builder 2.1.2"

查看:126
本文介绍了Rails 3 / Cucumber问题:“...已经激活构建器3.0.0,但您的Gemfile需要构建器2.1.2”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直使用黄瓜没有麻烦了Rails 3一段时间,但今天一整天修改(包括宝石清理),我得到以下错误每当我运行黄瓜功能


您已经激活builder
3.0.0,但是您的Gemfile需要builder 2.1.2。考虑使用bundle
exec。 (Gem :: LoadError)


在我的机器上的多个rails项目中尝试了所有这些都受到影响。不太确定如何解决这一个 - 试过安装2.1.2&指定它在gemfile,但没有快乐。



bundle exec cucumber features工作,但它似乎不能很好地与自动测试。

解决方案 / div>

看起来像你的gem清理后,builder已被删除,然后安装最新版本(3.0.0)。但是rails3和一些其他gem需要〜> 2.1.2,这意味着构建器版本应该> = 2.1.2和& 3.0.0。因此,您需要从您的系统gem中删除3.0.0:

  gem卸载构建器



如果需要,使用 sudo



然后在您的项目中:

 捆绑安装

注意:如果您已将手动构建器放入Gemfile中,请确保输入〜> 2.1.2。否则bundler将尝试安装最新的稳定版本(3.0.0),这与当前版本的rails和其他流行的gem不兼容:

  gembuilder,〜> 2.1.2

将每个项目的宝石存储在不同的位置:

  bundle install --path .gems 

在这种情况下,你可以做你想要的一切,你的系统宝石,它将降低风险,像你现在的情况。


I've been using cucumber without trouble for with Rails 3 for a while, but after a whole bunch of tinkering today (including gem cleanup), I get the following error whenever I run "cucumber features"

You have already activated builder 3.0.0, but your Gemfile requires builder 2.1.2. Consider using bundle exec. (Gem::LoadError)

Tried it in multiple rails projects on my machine - all are effected. Not quite sure how to tackle this one - tried installing 2.1.2 & specifying it in the gemfile, but no joy.

"bundle exec cucumber features" does work, but it doesn't seem to play nicely with autotest.

Any suggestions regarding what I've done (and better still how to fix it) much appreciated.

解决方案

It looks like after your gem cleanup, builder has been removed and then installed latest version (3.0.0). But rails3 and some of other gems requires ~> 2.1.2, which means that builder version should be >= 2.1.2 and < 3.0.0. So you need to remove 3.0.0 from your system gems:

gem uninstall builder

Use sudo if needed.

Then in your project:

bundle install

NOTE: If you had put manually builder into your Gemfile, make sure that you put ~> 2.1.2. Otherwise bundler will try to install latest stable version (3.0.0), which is not compatible with current version of rails and other popular gems:

gem "builder", "~> 2.1.2"

I would recommend you to store gems in separate locations for each project:

bundle install --path .gems

In this case you can do everything you want with your system gems and it will reduce risk to get in situation like you do now.

这篇关于Rails 3 / Cucumber问题:“...已经激活构建器3.0.0,但您的Gemfile需要构建器2.1.2”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆