1
votes

I an trying to open my root page it shows error "Internal server error"

=> Booting Thin  

=> Rails 4.2.6 application starting in development on http://localhost:4000
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server
Thin web server (v1.6.4 codename Gob Bluth) Maximum connections set to 1024 Listening on localhost:4000, CTRL+C to stop
DEPRECATION WARNING: You didn't set secret_key_base. Read the upgrade documentation to learn more about this new config option. (called from require at /home/smk/test/test/BMS-New/bin/rails:9) Unexpected error while processing request: Missing secret_token and secret_key_base for 'development' environment, set these values in config/secrets.yml /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/application.rb:534:in validate_secret_key_config!' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/application.rb:246:inenv_config' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/engine.rb:514:in call' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/application.rb:165:incall' /home/smk/test/test/BMS-New/vendor/bundle/gems/rack-1.6.4/lib/rack/content_length.rb:15:in call' /home/smk/test/test/BMS-New/vendor/bundle/gems/thin-1.6.4/lib/thin/connection.rb:86:inblock in pre_process' /home/smk/test/test/BMS-New/vendor/bundle/gems/thin-1.6.4/lib/thin/connection.rb:84:in catch' /home/smk/test/test/BMS-New/vendor/bundle/gems/thin-1.6.4/lib/thin/connection.rb:84:inpre_process' /home/smk/test/test/BMS-New/vendor/bundle/gems/thin-1.6.4/lib/thin/connection.rb:53:in process' /home/smk/test/test/BMS-New/vendor/bundle/gems/thin-1.6.4/lib/thin/connection.rb:39:inreceive_data' /home/smk/test/test/BMS-New/vendor/bundle/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in run_machine' /home/smk/test/test/BMS-New/vendor/bundle/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:inrun' /home/smk/test/test/BMS-New/vendor/bundle/gems/thin-1.6.4/lib/thin/backends/base.rb:73:in start' /home/smk/test/test/BMS-New/vendor/bundle/gems/thin-1.6.4/lib/thin/server.rb:162:instart' /home/smk/test/test/BMS-New/vendor/bundle/gems/rack-1.6.4/lib/rack/handler/thin.rb:19:in run' /home/smk/test/test/BMS-New/vendor/bundle/gems/rack-1.6.4/lib/rack/server.rb:286:instart' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/commands/server.rb:80:in start' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:inblock in server' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in tap' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:inserver' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in run_command!' /home/smk/test/test/BMS-New/vendor/bundle/gems/railties-4.2.6/lib/rails/commands.rb:17:in' /home/smk/test/test/BMS-New/bin/rails:9:in require' /home/smk/test/test/BMS-New/bin/rails:9:in' /home/smk/test/test/BMS-New/vendor/bundle/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in load' /home/smk/test/test/BMS-New/vendor/bundle/gems/spring-1.7.1/lib/spring/client/rails.rb:28:incall' /home/smk/test/test/BMS-New/vendor/bundle/gems/spring-1.7.1/lib/spring/client/command.rb:7:in call' /home/smk/test/test/BMS-New/vendor/bundle/gems/spring-1.7.1/lib/spring/client.rb:30:inrun' /home/smk/test/test/BMS-New/vendor/bundle/gems/spring-1.7.1/bin/spring:49:in <top (required)>' /home/smk/test/test/BMS-New/vendor/bundle/gems/spring-1.7.1/lib/spring/binstub.rb:11:inload' /home/smk/test/test/BMS-New/vendor/bundle/gems/spring-1.7.1/lib/spring/binstub.rb:11:in <top (required)>' /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' /home/smk/test/test/BMS-New/bin/spring:13:in' bin/rails:3:in load' bin/rails:3:in'

1

1 Answers

0
votes

In your config/secrets.yml file remove everything add this:

development:
  secret_key_base: bcbfd4e5010b035e62898f964188362877783b43f94bf883cf4b1d82d9224349789fb9dd0c2f33a200acfa266024a285e324caa3b20d0a9a352014156e47ec5c

test:
  secret_key_base: af068d8662bf954a2afeb27c64bbcdeb56b730029272bd3daff7e00c3c076999b3d2297747a3cef0550d3efd5cf8072e0477b8a62f096c94ab124f0d99320d20

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

Your error refers that in your secrets.yml file secret_key_base and secret_token is missing.

FYI: You can change the secret_key_base as you like. If you don't have this file then create one. For different environment the secret_key_base will be different. You should add the environment there also. Here, I give key base for development/production/test environment