使用机架 1.3 和导轨 3.0.9
如何将机架 1.3.0 与导轨一起使用。我尝试将 gem 'rack', '1.3.0'
放入 Gemfile 中,并进行捆绑更新rack
,但它说
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 3.0.9) depends on
rack (~> 1.2.1)
rack (1.3.0)
我遇到了rack版本<= 1.2.3的问题这里lib/rack/utils.rb#L495。我在机架 1.3.0 中没有看到这个,所以想尝试一下。但显然 Rails 不允许使用rack 1.3。
有什么解决方法吗?
How can I use rack 1.3.0 with rails. I tried putting gem 'rack', '1.3.0'
in Gemfile and did bundle update rack
but it says
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 3.0.9) depends on
rack (~> 1.2.1)
rack (1.3.0)
I am having issues with rack version <= 1.2.3 here lib/rack/utils.rb#L495. I don't see this in rack 1.3.0, so wanted to give a try. But clearly rails is not allowing to use rack 1.3.
Is there any workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答是:您不能将机架 1.3 与 Rails 3.0 一起使用。正如错误所述,Rails 3.0.9 依赖于 Rack 1.2.x,其中 x >= 1。
如果您需要rack 1.3,您应该尝试 Rails 3.1,它当前依赖于rack ~>= 1.1。 1.3.2(即 1.3.x,其中 x >= 2)。另一种方法是在本地更改 actionpack gemspec 以要求机架 1.3。但当你孤身一人时,可能会有怪物从洞里出来,吃掉所有你所爱的人......
The short answer is: you can't use rack 1.3 with Rails 3.0. As the error states, Rails 3.0.9 depends on Rack 1.2.x with x >= 1.
If you need rack 1.3, you should try Rails 3.1 which currently depends on rack ~> 1.3.2 (i.e. 1.3.x with x >= 2). An alternative could be to change the actionpack gemspec locally to require rack 1.3. But then you are on your own and there will probably be grues coming out of holes and eating all your loved ones...