2009-12-02 70 views
2

当我尝试应用部署我的轨到我的共享主机(Dreamhost的)我得到这个错误:如何冻结不想冻结的宝石? (架)

can't activate rack (~> 1.0.1, runtime) for [], already activated rack-1.0.0 for [] 

所以我想冻结我的开发环境机架宝石,并将其添加到项目,但即使我有这个在我到config/environment.rb:

config.gem 'rack' 

做一个耙宝石:打开包装:依赖关系不冻结的宝石。

ajmbp:trunk ajl$ rake gems:unpack:dependencies 
(in /Users/ajl/dev/site/trunk) 
ajmbp:trunk ajl$ ll vendor/gems/ 
.svn/   haml-2.2.14/ net-ssh-2.0.16/ 

我尝试添加另一颗宝石的config.gem只是为了测试(RedCloth),并且不按预期方式工作,但机架没有运气。

任何想法? 谢谢!

回答

0

你有检查你的环境变量(RUBY_GEMS我认为是,或类似的东西)? 另外,您的environment.rb和(如果您使用fastcgi)您的.fcgi。

确保路径从最高优先级到最低优先级。

0

请参阅this article

Any gem that is loaded in your Rakefile (e.g. metric_fu, vlad, etc) is considered to be a ‘framework gem’ by Rails, and such gems are not unpacked. Given that the vendor/gems directory is not yet in the load path when the Rakefile is loading, this is probably a good idea.

In other words, if you have a library that provides Rake tasks, or is otherwise necessary for your .rake files to be valid, don’t expect “config.gem” and friends to handle it for you.

对于Dreamhost看到他们的own documentation安装自己的宝石。或者请参阅this excellent article关于如何加载自己的软件包和宝石(请注意,它不适合心脏不好)。

但是我的所有阅读都告诉我,由于Passenger可能使用Dreamhost安装的Rack版本,您可能仍会遇到麻烦。

祝你好运。

1

你想升级到Rails 2.3.5吗?阅读本主题: Bypassing rack version error using Rails 2.3.5

简答:你不能。但Dreamhost将在周一升级Rails。

+0

后续行动 - 实际上是的,你可以,但只是让dreamhost把你转移到一个新的服务器上会很复杂也容易得多。 – 2010-05-10 18:11:56