How to switch between different version of gem ins

2019-04-04 07:19发布

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?

2条回答
在下西门庆
2楼-- · 2019-04-04 08:04

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
查看更多
兄弟一词,经得起流年.
3楼-- · 2019-04-04 08:09

Use bundler it will manage it for you.

查看更多
登录 后发表回答