How to force rack to work around the usual “You have already activated rack…” bug?

后端 未结 6 1760
日久生厌
日久生厌 2021-01-01 11:21

This is a common question, but none of the answers seem to solve the issue. I get the usual: You have already activated rack 1.4.1, but your Gemfile requires rack 1.3.

6条回答
  •  孤城傲影
    2021-01-01 11:59

    The problem is this:

    • You have (at least) two versions of Rack installed.

    • Your Gemfile calls for one version (1.3.6). Your current environment is providing another version (1.4.1).

    • By the time your application executes, the current environment has already loaded 1.4.1.

    • Bundler knows you need to load 1.3.6, but it can't load it. You may not load more than one version of the same gem, so the 1.4.1 version wins since it was loaded first.

    • Bundler complains to you.

    Uninstall the problematic gems (e.g. gem uninstall rack -v 1.3.6). Even better, use RVM and gemsets to isolate your gems better and you won't encounter this issue.

提交回复
热议问题