2010-11-12 86 views
0

我正在將rails網站上傳到bluehost,這是一個適用於本地計算機的網站。不過,我很難將其配置爲在bluehost上運行。下面是我得到的錯誤:Bluehost上的Rails:「通過對等方重置連接」mod_fcgid錯誤

[warn] [client 74.220.197.129] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server 
[error] [client 74.220.197.129] Premature end of script headers: dispatch.fcgi ./../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement 
./../config/../vendor/rails/railties/lib/initializer.rb:271:in `require_frameworks': 
RubyGem version error: rack(1.1.0 not ~> 1.0.1) (RuntimeError) from ./../config/../vendor/rails/railties/lib/initializer.rb:134:in `process' from ./../config/../vendor/rails/railties/lib/initializer.rb:113:in `send' from ./../config/../vendor/rails/railties/lib/initializer.rb:113:in `run' from ./../config/environment.rb:11 from dispatch.fcgi:21:in `require' from dispatch.fcgi:21 

我已經安裝的機架1.0.1,和正確的.htaccess重命名給我文件的索引列表。這看起來像一個.htaccess錯誤。這是我的.htaccess文件:

AddHandler fcgid-script .fcgi 
AddHandler cgi-script .cgi 
# For security reasons, Option followsymlinks cannot be overridden. 
# Options +FollowSymLinks +ExecCGI 
Options +SymLinksIfOwnerMatch +ExecCGI 

RewriteEngine On 
RewriteRule ^$ index.html [QSA] 
RewriteRule ^([^.]+)$ $1.html [QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] 

ErrorDocument 500 /500.html 

#ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" 

我在做什麼錯了?

添加此到〜/ .bashrc文件:

+0

您使用的是哪個版本的Rails? – rwilliams 2010-11-12 18:11:16

+0

你可以發佈你的寶石名單輸出? – rwilliams 2010-11-12 18:14:46

回答

2

好吧,我通過以下操作解決了這個問題。 ..

export GEM_HOME=$HOME/ruby/gems 
export GEM_PATH=$GEM_HOME:/usr/lib64/ruby/gems/1.8 
export GEM_CACHE=$GEM_HOME/cache 
export PATH=$PATH:$HOME/ruby/gems/bin 

...運行此命令

gem install rails --version=2.3.5 

...並添加THI s行到environment.rb文件的頂部...

ENV['GEM_PATH'] = '/home8/opportx0/ruby/gems:/usr/lib64/ruby/gems/1.8' 

終於有效。

0

您的應用尋找機架1.1.0或更高版本,它的發現1.0.1

+0

我安裝了機架1.0.1,但仍然遇到同樣的問題。這看起來像一個服務器錯誤,而不是一個寶石錯誤......這在我的本地機器上工作。 – jakefuentes 2010-11-12 18:03:30

+0

我想我讀這個錯了。錯誤是說機架1.1.0不大於1.0.1,根本沒有意義。 – rwilliams 2010-11-12 18:12:47

相關問題