13

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?

steveyang
  • 9,178
  • 8
  • 54
  • 80

2 Answers2

12

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
megas
  • 21,401
  • 12
  • 79
  • 130
  • 2
    However, when executed, `cucumber` will still use the activated rack with version `1.4.1` of the system. `Bundle`specifies **which gem should be installed** but doesn't ensure **which gem will be activated**. – steveyang Mar 15 '12 at 07:59
  • 2
    @steven.yang You can use [`bundle exec`](http://gembundler.com/man/bundle-exec.1.html) to execute a command using the gem versions specified in your `Gemfile`. E.g. `bundle exec cucumber`. – matt Mar 15 '12 at 11:43
1

Use bundler it will manage it for you.

iafonov
  • 5,152
  • 1
  • 25
  • 21