Problems configuring route in Rails

Asked

Viewed 125 times

0

I am new as ruby programmer on Rails.

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

get 'hello/index'

And I typed in the URL localhost:3000/hello/index generated this error;inserir a descrição da imagem aqui

Could someone tell me what’s going wrong?

because I can’t get my page up if I set the route correctly?

Manage to solve the problem through this posting

https://stackoverflow.com/questions/33221961/application-html-erb-where-line-6-raised-typeerror-ruby-on-rails

in the archive views/layouts/Aplication.html.erb I switched that out;

 <%= 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 %>

Please, I’d just like to know why you decided.

1 answer

1


To compile the Coffeescript and Javascript Assets, Rails requires Javascript Runtime installed on your computer, if it does not have it, it returns this error during the Assets compilation. Usually this error does not occur with Linux and Mac users as Runtime is already installed.

It’s not a good practice you set for default, because you will lose compatibility with the application.css styles. One solution is to install Nodejs and restart the server, or install Gem gem 'coffee-script-source', '1.8.0' and then rotate bundle update coffee-script-source

  • I installed the latest version of Javascript and it didn’t work, then I installed Nodejs and it didn’t work, any more suggestions? please

  • 1

    Try using any of these solutions: http://stackoverflow.com/questions/8362458/error-when-running-rails-app-execjsruntimeerror

Browser other questions tagged

You are not signed in. Login or sign up in order to post.