Phusion 乘客错误:您已激活机架 1.2.1,但您的 Gemfile 需要机架 1.2.2 [英] Phusion Passenger Error: You have activated rack 1.2.1, but your Gemfile requires rack 1.2.2

查看:20
本文介绍了Phusion 乘客错误:您已激活机架 1.2.1,但您的 Gemfile 需要机架 1.2.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Dreamhost 共享服务器上运行 Ruby on Rails 应用程序.到目前为止一切都很好,除了一个我无法解开的奇怪错误.

I'm trying to run a Ruby on Rails app on a Dreamhost shared server. All is well so far except one weird bug I have not been able to unravel.

有时当我访问网络应用程序时,我会收到 Phusion Passenger 错误提示,

Sometimes when I visit the web app, I get presented with a Phusion Passenger error saying,

您已经激活了 rack 1.2.1,但是您的 Gemfile 需要 rack 1.2.2.考虑使用 bundle exec.

You have already activated rack 1.2.1, but your Gemfile requires rack 1.2.2. Consider using bundle exec.

当我只是刷新页面时,它似乎可以工作,但是 - 没有更多 Phusion Passenger 错误消息.

When I just refresh the page it seems to work, though - no more Phusion Passenger error message.

关注其他堆栈溢出线程和类似 Dreamhost wiki,我在 config/environment.rb 文件的顶部添加了以下内容:

Following other stack overflow threads and a similar Dreamhost wiki, I added the following to the top of the config/environment.rb file:

if ENV['RAILS_ENV'] == 'production'  # don't bother on dev
  ENV['GEM_PATH'] = '/home/myusername/.gems' + ':/usr/lib/ruby/gems/1.8'
end

推荐答案

在你的 Gemfile 中编辑后尝试重新启动你的服务器并输入:gem 'rack', '1.2.1'

try to restart your server after edit in your Gemfile and put this: gem 'rack', '1.2.1'

这篇关于Phusion 乘客错误:您已激活机架 1.2.1,但您的 Gemfile 需要机架 1.2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆