Problems setting up route in rails

0

I'm new to ruby on rails programmer.

I ran in the windows console rails generate controller hello then I created the page in the View folder an index.html.erb file, then I configured the route in the routes.erb file creating the following line;

get 'hello / index'

And I typed the URL localhost: 3000 / hello / index generated this error;

Couldsomeonetellmewhat'swrong?

WhycannotIuploadmypageifIconfiguredtheroutecorrectly?

Gettingtheproblemresolvedthroughthispost

link

in the views / layouts / application.html.erb file I changed this;

 <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

therefore;

 <%= stylesheet_link_tag    'default', media: 'all', 'data-turbolinks-track' => true %>
    <%= javascript_include_tag 'default', 'data-turbolinks-track' => true %>

I'd just like to know why you resolved.

    
asked by anonymous 17.05.2017 / 20:31

1 answer

1

To compile CoffeeScript and JavaScript assets, Rails requires the JavaScript Runtime installed on your computer, if it does not have it, it returns this error during compilation of the assets. Usually this error does not occur with Linux and Mac users, since Runtime is already installed.

It is not a good practice to set yourself to default because you will lose compatibility with the application.css styles. One solution is to install the NodeJs and restart the server, or else install the gem gem 'coffee-script-source', '1.8.0' and then run bundle update coffee-script-source

    
20.05.2017 / 16:24