haml_coffee_assets/configuration.rb:28: odd number list for Hash (SyntaxError) || Rails/Passenger/Dreamhost

StackOverflow https://stackoverflow.com/questions/16403629

Question

I have been fighting to get a rails app working under passenger in a shared dreamhost server.

My latest error is as follows.

$ 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

My config.ru looks like

 # 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

And my Gemfile like

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

I'm thinking the ruby version might be the problem (I was using 1.9.3 locally with rvm)

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

Should I just cut my loses and install it with fastCGI or does it look fixable??

Was it helpful?

Solution

Your host is running Ruby 1.8. That hash syntax ({key: value}) is only available in Ruby 1.9. You'll have to choose a different gem, choose a different host, or fork the gem and modify it to use old hash syntax ({:key => value}). The best bet is to find a host running a modern version of Ruby, as 1.8.x is going to be unsupported by Rails in the very near future.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top