Help Installing Rails Forem

So, I'm pretty new to rails and the like, and I tried to install this over the last few hours and got 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 ':' waiting for $ end (SyntaxError) ... sion_store: cookie_store, key: '_forums_session' ^ from / usr / lib 64 / 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 / lib 64 / 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 / lib 64 / ruby ​​/ gems / 1.8 / gems / railties-3.2. 11 / lib / rails / engine.rb: 587 from / usr / lib 64 / 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 / lib 64 / 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 / lib 64 / 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 run_initializers' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/application.rb:136:in initialization! from / usr / lib 64 / 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.rbhaps from / usr / lib 64 / 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 required "from / usr / lib 64 / 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 required "from / usr / lib 64 / 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:in require_environment!' from /usr/lib64/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/commands.rb:25 from script/rails:6:in required "from script / rails: 6

So is something missing here or ...?

I downloaded this file: https://github.com/radar/forem.heroku.com

0
source share
1 answer

The error you get is due to the fact that you are using the Ruby 1.9+ hash syntax in an old 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 the session_store.rb file as follows:

 # Be sure to restart your server when you modify this file. Forums::Application.config.session_store :cookie_store, :key => '_forums_session' 
+1
source

Source: https://habr.com/ru/post/1483640/


All Articles