Search code examples
rubypassengergitorious

Gitorious on Dreamhost: Gemfile syntax error


While trying to deploy "self hosted" Gitorious onto a Dreamhost shared hosting account, I get a syntax error in a Gemfile during the "bundle install" command:

$ bundle install --path vendor/bundle
Gemfile syntax error:
/home/<user>/git.<user>.org/Gemfile:33: syntax error, unexpected ':', expecting $end

gem 'rugged', git: 'https://github.com/libgit2/r... ^

Here's the Gemfile line that's choking:

gem 'rugged', git: 'https://github.com/libgit2/rugged.git', branch: 'development', submodules: true

The version of ruby is kind of old and some googling makes me think that might matter...

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

Anyone have any ideas? The closest I've been to troubleshooting Ruby anything is setting up some Puppet related stuff at work. I'm not so sharp on this technology.


Solution

  • yes,

    the second parameter on that line is a hash.

    ruby 1.8.7 doesn't support the new hash notation
    a = { b: 1 }

    this is valid from ruby 1.9 and later.

    for ruby 1.8.7 you need to format your hashes like:

    a = { :b => 1 }

    So in your case:

    gem 'rugged', :git => 'https://github.com/libgit2/rugged.git', :branch => 'development', :submodules => true

    should be ok.