我正在将rails网站上传到bluehost,这是一个适用于我本地计算机的网站。但是我无法将其配置为在bluehost上运行。这是我得到的错误:
[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"
我做错了什么?
答案 0 :(得分:2)
好的,我通过执行以下操作解决了这个问题:
将此添加到〜/ .bashrc文件...
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
...并将此行添加到environment.rb文件的顶部...
ENV['GEM_PATH'] = '/home8/opportx0/ruby/gems:/usr/lib64/ruby/gems/1.8'
终于有效了。
答案 1 :(得分:0)
您的应用正在寻找Rack 1.1.0或更高版本,它正在寻找1.0.1