0

我一直在努力让 Rails 应用程序在共享的 Dreamhost 服务器中在乘客下工作。

我的最新错误如下。

$ rails console
/home/entrack/.gems/gems/haml_coffee_assets-1.12.0/lib/haml_coffee_assets.rb:10:in `require': /home/entrack/.gems/gems/haml_coffee_assets-1.12.0/lib/haml_coffee_assets/configuration.rb:28: odd number list for Hash (SyntaxError)
  self.dependencies           = { hc: 'hamlcoffee_amd' }
                                     ^
/home/entrack/.gems/gems/haml_coffee_assets-1.12.0/lib/haml_coffee_assets/configuration.rb:28: syntax error, unexpected ':', expecting '}'
  self.dependencies           = { hc: 'hamlcoffee_amd' }
                                     ^
/home/entrack/.gems/gems/haml_coffee_assets-1.12.0/lib/haml_coffee_assets/configuration.rb:28: syntax error, unexpected '}', expecting kEND
from /home/entrack/.gems/gems/haml_coffee_assets-1.12.0/lib/haml_coffee_assets.rb:10
from /home/entrack/.gems/gems/joosy-1.0.0.RC4/lib/joosy.rb:1:in `require'
from /home/entrack/.gems/gems/joosy-1.0.0.RC4/lib/joosy.rb:1
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
from /home/entrack/hubtrack.binarygeometry.net/config/application.rb:7
from /home/entrack/.gems/gems/railties-3.2.13/lib/rails/commands.rb:39:in `require'
from /home/entrack/.gems/gems/railties-3.2.13/lib/rails/commands.rb:39
from script/rails:6:in `require'
from script/rails:6

我的 config.ru 看起来像

 # This file is used by Rack-based servers to start the application.
 require ::File.expand_path('../config/environment',  __FILE__)
 run HubBlog::Application
 ENV['GEM_HOME'] = '/home/entrack/.gems' + ':/usr/lib/ruby/gems/1.8'
 require 'rubygems'
 Gem.clear_paths

我的 Gemfile 喜欢

source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'joosy', '1.0.0.RC4'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'zurb-foundation', '~> 4.0.0'
  gem 'execjs'
  #gem 'therubyracer', #:platforms => :ruby
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby
  gem 'uglifier', '>= 1.0.3'
end

我认为 ruby​​ 版本可能是问题(我在本地使用 1.9.3 和 rvm)

ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

我应该减少损失并使用 fastCGI 安装它还是看起来可以修复?

4

1 回答 1

1

您的主机正在运行 Ruby 1.8。该哈希语法 ( {key: value}) 仅在 Ruby 1.9 中可用。您必须选择不同的 gem,选择不同的主机,或者 fork gem 并修改它以使用旧的哈希语法 ( {:key => value})。最好的办法是找到一个运行现代版 Ruby 的主机,因为在不久的将来 Rails 将不再支持 1.8.x。

于 2013-05-06T17:19:10.073 回答