mardi 19 mai 2015

Syntax error in route.rb Ruby on Rails

Just started learning Ruby on Rails and I have alot of issues setting up the project route in config/route.rb.

The main issue is, when I try making a Default route, it just won´t work.

When I make SOME commands in the Terminal, I get a Warning like this: Warning: Running gem pristine --all to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.

This is the code in my routes.rb now: Rails::application.routes.draw do

:get 'demo/index'

match ":controller(/:action(/:id(.:format)))" , :via => :get

strong textThis is the error message I get when trying to open up in "localhost":

SyntaxError /Users/cathrinjanoy/Sites/simple_cms/config/routes.rb:3: syntax error, unexpected tSTRING_BEG, expecting keyword_end :get 'demo/index' ^

Extracted source (around line #3):

1 2 3 4 5 6

Rails::application.routes.draw do

:get 'demo/index'

match ":controller(/:action(/:id(.:format)))" , :via => :get

Rails.root: /Users/cathrinjanoy/Sites/simple_cms

config/routes.rb:3: syntax error, unexpected tSTRING_BEG, expecting keyword_end

This error occurred while loading the following files: /Users/cathrinjanoy/Sites/simple_cms/config/routes.rb

Can anyone help? I am so new to this but have been sitting for hours to try and get the routes.rb working and now I felt like asking for help!

Aucun commentaire:

Enregistrer un commentaire