You have already activated rack 1.6.0, but your Gemfile requires rack 1.6.4

前端 未结 6 1748
渐次进展
渐次进展 2021-02-05 09:32

Similar to problem with rack 1.3.2. You have already activated rack 1.3.2, but your Gemfile requires rack 1.2.3 -- I\'m experiencing You have already activated rack 1.6.0,

相关标签:
6条回答
  • 2021-02-05 10:01

    you need to uninstall one version of rack which is not required.

    Do this please

    gem uninstall rack -v 1.6.0
    

    Reference: How to force rack to work around the usual "You have already activated rack..." bug?

    0 讨论(0)
  • 2021-02-05 10:01

    I experienced this issue:

    Here's my solution:

    Solution 1:

    This solution works a lot of the time, simply update the gem causing the issue.

    bundle update rack
    

    Solution 2:

    In some cases Solution 1 may not work, and you will need to edit your Gemfile.lock file.

    Simply, open your Gemfile.lock file and then change the version to the update requested.

    In my case, I had rack 2.0.7 defined in my Gemfile.lock file, but my application required rack 2.1.2, I simply had to modify it to rack 2.1.2 in the Gemfile.lock file.

    I then had to uninstall the previous version of rack which is rack 2.0.7

     gem uninstall rack -v 2.0.7
    

    And finally installed the new gem in production

    bundle install --without development test
    

    Solution 3:

    In very rare cases Solution 1 and Solution 2 may not work, and you will need to edit your Gemfile before updating the gem.

    In my case, the gem was puma, I had puma ~> 3.11 defined in my Gemfile, but my application required puma ~> 4.3.1. At this point running bundle update puma and editing my Gemfile.lock file didn't work, since puma ~> 3.11 version specified in the Gemfile would not allow an update to puma ~> 4.3.1.

    I simply had to change the version of puma in the Gemfile to puma ~> 4.3.1 and then ran the command.

    bundle update puma
    

    That's all.

    I hope this helps

    0 讨论(0)
  • 2021-02-05 10:02

    Run it like this: bundle exec rails s. This will use settings from your Gemfile.lock

    0 讨论(0)
  • 2021-02-05 10:03

    These issues might arise if you are using local or global gemset for more than one project. Why not create seprate gemset for each project.

    You can do this using rvm

    Create new gemset

    rvm gemset create new_test
    
    rvm gemset use new_test
    
    bundle install
    
    0 讨论(0)
  • 2021-02-05 10:08

    You can simply run below cmd to get the latest rack installed in server to fix the issue:

    gem install rack
    
    0 讨论(0)
  • 2021-02-05 10:17

    One experienced Rails developer highly recommends using binstubs. Have it installed by:

    bundle install --binstubs
    

    and run it via relative path:

    ./bin/rails server
    

    or what is most recommended update PATH and forget about bundler issues:

    export PATH="./bin:$PATH"
    rails server
    
    0 讨论(0)
提交回复
热议问题