4

I'm recently began working on a project which I've cloned from github.

Everytime I try start the rails server I get the following error:

 
/Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in load': /Users/thomas/Projects/BillingMiddleware/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_BillingMiddleware_session'
                              ^
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:inload'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in load_dependency'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:inload'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/engine.rb:588
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/engine.rb:587:in each'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/engine.rb:587
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:30:ininstance_exec'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:30:in run'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:55:inrun_initializers'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:54:in each'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:54:inrun_initializers'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/application.rb:136:in initialize!'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:insend'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in method_missing'
    from /Users/thomas/Projects/BillingMiddleware/config/environment.rb:5
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:inrequire'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in require'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:inload_dependency'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in require'
    from /Users/thomas/Projects/BillingMiddleware/config.ru:4
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:ininstance_eval'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in initialize'
    from /Users/thomas/Projects/BillingMiddleware/config.ru:1:innew'
    from /Users/thomas/Projects/BillingMiddleware/config.ru:1

My collegue is also working on the project and doesn't seem to have any problems starting the server. He is running the same version of ruby, rails and WeBrick as me.

I've tried changing the syntax from key: to :key =>, this shouldn't be the problem though as I am running ruby version 1.9.3. If I make that change anyhow I get a different error message:

/Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load': /Users/thomas/Projects/BillingMiddleware/config/initializers/wrap_parameters.rb:8: syntax error, unexpected ':', expecting kEND (SyntaxError)
  wrap_parameters format: [:json]
                         ^
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/engine.rb:588
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/engine.rb:587:in `each'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/engine.rb:587
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/thomas/Projects/BillingMiddleware/config/environment.rb:5
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/thomas/Projects/BillingMiddleware/config.ru:4
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
    from /Users/thomas/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
    from /Users/thomas/Projects/BillingMiddleware/config.ru:1:in `new'
    from /Users/thomas/Projects/BillingMiddleware/config.ru:1

I've tired completely removing and re-installing rvm, ruby and rails several times to no prevail. I’ve also tried running bundle install which hasn’t help.

Does anyone have any idea of what’s going wrong?

Thanks

2 Answers 2

5

Try changing your hashes to :key => :value syntax. The same error and fixes are discussed at Rails 3.1 Deployment to Heroku Error. The temp fixes suggested are: config/initializers/session_store.rb

App::Application.config.session_store :cookie_store, :key => '_BillingMiddleware_session'

config/initializers/wrap_parameters.rb

ActionController::Base.wrap_parameters :format => [:json]
Sign up to request clarification or add additional context in comments.

7 Comments

This does seem to be a quick fix for the problem. I'm just wondering why it's complaining about this syntax for hashes when I'm running Ruby 1.9.3?
You are still using ruby 1.8.7 somehow in your system. Atleast you are up and running. Good luck.
Lots of code already commited to the projects though has the new syntax, seems pointless changing it all back to the old syntax when it's working for the other members of the projects. Is this anything else I can try? When I run ruby -v I get ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0] I'm using RVM and when I run rvm list rubies I only get =* ruby-1.9.3-p194 [ x86_64 ] I've also run rvm use ruby-1.9.3-p194 which hasn't helped.
Are you getting the same error in other parts of your app too? I thought that this is an issue only during initialization, and isn't affecting the rest of the app.
This was the case initially, but with the implementation of the quick fix, it's come to my attention the issue is affecting files within the app, once they're run by the server. Is there anywhere else within my enviroment that I can check isn't defaulting back to an older version of ruby?
|
1

Looks like hash syntax on another line, after you fixed that one. Check config/intializers/wrap_parameters.rb and i wonder if this project got the flag to "not" use the new syntax?

3 Comments

I've changed both not to use the new syntax, but again it seems to find more examples within the project using the new syntax and complain about them. The project was created by my collegue himself, so I'm realtively sure it won't have a flag not to use the new syntax. He seems to be able to start the server with no problems at his end.
What does your ruby -v say? Have you restarted your console tab maybe something weird is going on. AND are you on Lion and he on Snow Leopard?
When I run ruby -v It returns ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]. Each time I've performed an update or installed something I've been restarting my console. Yes, both of our computers are running 10.7.3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.