简体   繁体   中英

How to force Rails to use gem of version X

I have a rails app with the config/environment.rb line

config.gem 'authlogic', :version => '2.1.2'

The system gem for authlogic is 2.1.4 The one in my GEM_PATH is 2.1.2

No matter what I try, Rails is only using the 2.1.4 version, which is a problem. How to force rails to use 2.1.2?

Thanks

我建议使用Bundler

i've made a test here, included the gem authlogic, choose to use the 2.1.3 version, and the application ran without problems.

then i've uninstalled the gem (gem uninstall authlogic -v=2.1.3), and my application didn't ran anymore, normal behavior (i'm using rails 2.3.8 for this test)

you could try uninstalling and then installing the gem again

为安全起见,请卸载2.1.4版本,冻结2.1.2,然后再卸载2.1.2。

Unpack the gems into your rails app. This'll also help in deployment.

rake gems:unpack

系统管理员重新安装了一些宝石,所有问题都消失了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM