2

I was trying to found an answer for a couple of days but found nothing. I know there are a lot of similar questions but they can't help me.

I've started learning Rails using http://guides.rubyonrails.org/getting_started.html and was moving forward till terminal restart. Here is an error messages and code samples:

walker@DESKTOP-L15NDIS:~/blog$ rails routes
/home/walker/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/app_loader.rb:40:
warning: Insecure world writable dir
/home/walker/.rvm/gems/ruby-2.3.1@global/bin in PATH, mode 040777
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

   * development - set it to false
   * test - set it to false (unless you use a tool that preloads your test environment)
   * production - set it to true

 You don't have any routes defined!

 Please add some routes in config/routes.rb.

 For more information about routes, see the Rails guide: http://guides.rubyonrails.org/routing.html.

routes.rb:

Rails.application.routes.draw do
    root 'welcome#index'
    resources :articles
end

config/environments/development.rb:

 config.eager_load = false

config/environments/test.rb:

config.eager_load = false 

config/environments/production.rb

config.eager_load = true

Starting server:

 walker@DESKTOP-L15NDIS:~/blog$ rails s
 /home/walker/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/app_loader.rb:40:
 warning: Insecure world writable dir /home/walker/.rvm/gems/ruby-2.3.1@global/bin in PATH, mode 040777
 => Booting Puma
 => Rails 5.0.1 application starting in development on http://localhost:3000
 => Run `rails server -h` for more startup options
 config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

   * development - set it to false
   * test - set it to false (unless you use a tool that preloads your test environment)
   * production - set it to true

 Puma starting in single mode...
 * Version 3.7.0 (ruby 2.3.1-p112), codename: Snowy Sagebrush
 * Min threads: 5, max threads: 5
 * Environment: development
 * Listening on tcp://0.0.0.0:3000
 Use Ctrl-C to stop

Localhost displaying error message:

The page you were looking for doesn't exist.

You may have mistyped the address or the page may have moved.

Console output:

Started GET "/" for 127.0.0.1 at 2017-02-01 16:59:46 +0200 Started GET
"/" for 127.0.0.1 at 2017-02-01 16:59:46 +0200

ActionController::RoutingError (No route matches [GET] "/"):

ActionController::RoutingError (No route matches [GET] "/"):

actionpack (5.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:53:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.1) lib/rails/engine.rb:522:in `call'
puma (3.7.0) lib/puma/configuration.rb:226:in `call'
puma (3.7.0) lib/puma/server.rb:578:in `handle_request'
puma (3.7.0) lib/puma/server.rb:415:in `process_client'
puma (3.7.0) lib/puma/server.rb:275:in `block in run'
puma (3.7.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread'

What you will suggest to fix this?

Note: All this stuff worked well till terminal restart.

P.S. I created another app, and it works fine till terminal restart.

P.P.S. I'm running Linux subsystem on Windows 10 Pro.

P.P.P.S. I can't use any Linux distro or buy MacBook

Hizqeel
  • 947
  • 3
  • 20
  • 23
  • Based on the first part, how are your file permissions for routes.rb ? – lcguida Feb 01 '17 at 16:52
  • @Icguida nice question! I run ls -la but there is no routes.rb in console output. Btw, I can find routes.rb via Sublime or Explorer. File permissions to config folder are 0777 – Nathan Muir Feb 01 '17 at 18:58

2 Answers2

0

For me, it seems like system has problem with access rights to your home folder.

Try to run sudo chmod go-w /home/walker and if issue arises on other paths do the same thing.

Check similar question. In case you want to try Rails without 'infrastructural' problems, check out https://www.railstutorial.org/ and their option with cloud9 environment.

Community
  • 1
  • 1
w1t3k
  • 228
  • 2
  • 12
  • I've already tried all methods with changing permissions to the /home folder earlier, this issue persists. Btw, this is _warning_ message because Windows system has access to this folder. And it is insecure but not critical, I guess. – Nathan Muir Feb 01 '17 at 19:14
0

Thanks to @lcguida for question, which made me wonder about another way to find solution.

I finally found the cause to this problem. If someone got stuck by such issue check this link and also this link