Rails 3/Cucumber problem: “…already activated builder 3.0.0, but your Gemfile requires builder 2.1.2”

前端 未结 2 1699
执念已碎
执念已碎 2020-12-30 10:35

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 wheneve

相关标签:
2条回答
  • 2020-12-30 10:43

    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.

    0 讨论(0)
  • 2020-12-30 11:08

    Why not use the simpler way?

    bundle exec cucumber features

    I had the same problem with builder and some other gems. Tried using the "gem unistall" way but then I got an error saying that I need the newer gem. So I was in a deadlock.

    With the above command it worked ...

    0 讨论(0)
提交回复
热议问题