0

So i'm quite new to rails and such and I've been trying to install this for the past few hours and have been getting the following error when trying to run rails s, or if I try to install it with rails g forem:install

/usr/lib64/ruby/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load': /home/forem/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError) ...sion_store :cookie_store, key: '_forums_session' ^ from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in

load' from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in load_dependency' from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in load' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/engine.rb:588 from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/engine.rb:587:in each' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/engine.rb:587 from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:30:in instance_exec' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:30:in run' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:55:in run_initializers' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:54:in each' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:54:in run_initializers' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/application.rb:136:in initialize!' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in send' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in method_missing' from /home/forem/config/environment.rb:5 from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in require' from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in require' from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in load_dependency' from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in require' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/application.rb:103:in require_environment!' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/commands.rb:25 from script/rails:6:inrequire' from script/rails:6

So is there something I'm missing here or...?

The one that I downloaded is this one: https://github.com/radar/forem.heroku.com

Frankrd3
  • 15
  • 2
  • what's the content of file : `/home/forem/config/initializers/session_store.r` ? – Siwei Feb 14 '13 at 22:30
  • It contains: `# Be sure to restart your server when you modify this file. Forums::Application.config.session_store :cookie_store, key: '_forums_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rails generate session_migration") # Forums::Application.config.session_store :active_record_store ` – Frankrd3 Feb 14 '13 at 22:32
  • What does'ruby -v' say? – cthulhu Feb 14 '13 at 22:37
  • It says `ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]` – Frankrd3 Feb 14 '13 at 22:47

1 Answers1

1

The error you're getting is due to the fact that you're using the Ruby 1.9+ hash syntax in an older version of Ruby that does not support it. You need to either upgrade Ruby to 1.9.2 or 1.9.3, or change the second line of session_store.rb file to be:

# Be sure to restart your server when you modify this file.
Forums::Application.config.session_store :cookie_store, :key => '_forums_session'
Peter Brown
  • 50,956
  • 18
  • 113
  • 146
  • Thank you, i'll go ahead and try that – Frankrd3 Feb 14 '13 at 23:23
  • Right, now i'm getting this: >rails g forem:install >/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `': >It seems your ruby installation is missing psych (for YAML output). >To eliminate this warning, please install libyaml and reinstall your >ruby. >/usr/local/lib/ruby/gems/1.9.1/gems/activerecord->3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:12>08:in `initialize': could not connect to server: No such file or >directory (PG::Error) > Is the server running locally and accepting > connections on Unix domain socket "/tmp/.s.PGSQL.5432"? – Frankrd3 Feb 14 '13 at 23:44
  • That's definitely an unrelated issue. I'd recommend opening a new question for better visibility and to get more eyes on it. – Peter Brown Feb 14 '13 at 23:45
  • I think the issue may be because I have done a different instillation of ruby, i'm going to reinstall it. – Frankrd3 Feb 14 '13 at 23:52