How to switch between different version of gem installed?

落花浮王杯 提交于 2019-12-09 14:33:03

问题


I have three version of rack installed on local machine (rack (1.4.1, 1.3.6, 1.3.5)). For some gem (such as Cucumber), it requires a lower version of rack to be activated?

I have tried with bundle but there is no good.

When executed, cucumber will still use the activated rack with version 1.4.1 of the system. Bundlespecifies which gem should be installed but doesn't ensure which gem will be activated.

How could I activate certain version of rack?


回答1:


You can specify a version in gemfile of your project

gem "rack",  "1.3.5"

Pointed by matt:

To use gem specified in Gemfile:

bundle exec cucumber



回答2:


Use bundler it will manage it for you.



来源:https://stackoverflow.com/questions/9703286/how-to-switch-between-different-version-of-gem-installed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!