Hi, I''ve installed locomotive and all seemed to be fine. The localhost works and I can make a new project and generate controllers, views etc. However as soon as I put some Ruby code in a view html page I get a Syntax Error. Even just trying to use date won''t work. Anyone know where I''m going wrong? I''m keen to get coding! Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Go ahead and paste the contents of your view.html file and also copy-and-paste the exact error you''re getting. That will help us find the problem. On 11/15/06 8:07 AM, "cmcfarland" <cmcfarland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I''ve installed locomotive and all seemed to be fine. The localhost > works and I can make a new project and generate controllers, views etc. > However as soon as I put some Ruby code in a view html page I get a > Syntax Error. Even just trying to use date won''t work. > > Anyone know where I''m going wrong? I''m keen to get coding! > > Thanks in advance. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hello.rhtml in app/views/say <html> <head> <title>Hello, Rails!</title> </head> <body> <h1>Hello from Rails</h1> <p> It is now <%/= @time %>. </p> </body> </html> say_controller.rb in app/controllers class SayController < ApplicationController def hello @time = Time.now end end http://localhost:3000/say/hello SyntaxError in Say#hello Showing app/views/say/hello.rhtml where line #1 raised: compile error /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: unknown regexp option - p /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: parse error, unexpected $undefined. _erbout = ''''; _erbout.concat "<html>\r <head>\r <title>Hello, Rails!</title>\r </head>\r <body>\r <h1>Hello from Rails</h1>\r <p>\r It is now "; /= @time ; _erbout.concat ".\r </p>\r </body>\r</html>\r"; _erbout ^ /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: unknown regexp options - htl /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: parse error, unexpected $undefined. _erbout = ''''; _erbout.concat "<html>\r <head>\r <title>Hello, Rails!</title>\r </head>\r <body>\r <h1>Hello from Rails</h1>\r <p>\r It is now "; /= @time ; _erbout.concat ".\r </p>\r </body>\r</html>\r"; _erbout ^ /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: unterminated string meets end of file /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: parse error, unexpected $, expecting kEND Extracted source (around line #1): 1: <html> <head> <title>Hello, Rails!</title> </head> <body> <h1>Hello from Rails</h1> <p> It is now <%/= @time %>. </p> </body> </html> Trace of template inclusion: /app/views/say/hello.rhtml RAILS_ROOT: /Users/jim/Documents/work/demo/config/.. Paul Welty wrote:> Go ahead and paste the contents of your view.html file and also > copy-and-paste the exact error you''re getting. That will help us find the > problem. > > > On 11/15/06 8:07 AM, "cmcfarland" <cmcfarland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > > I''ve installed locomotive and all seemed to be fine. The localhost > > works and I can make a new project and generate controllers, views etc. > > However as soon as I put some Ruby code in a view html page I get a > > Syntax Error. Even just trying to use date won''t work. > > > > Anyone know where I''m going wrong? I''m keen to get coding! > > > > Thanks in advance. > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thankyou - Any help appreciated. I can''t get past this error. cmcfarland wrote:> hello.rhtml in app/views/say > > <html> > <head> > <title>Hello, Rails!</title> > </head> > <body> > <h1>Hello from Rails</h1> > <p> > It is now <%/= @time %>. > </p> > </body> > </html> > > say_controller.rb in app/controllers > > class SayController < ApplicationController > def hello > @time = Time.now > end > end > > http://localhost:3000/say/hello > > SyntaxError in Say#hello > > Showing app/views/say/hello.rhtml where line #1 raised: > > compile error > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > unknown regexp option - p > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > parse error, unexpected $undefined. > _erbout = ''''; _erbout.concat "<html>\r <head>\r <title>Hello, > Rails!</title>\r </head>\r <body>\r <h1>Hello from Rails</h1>\r > <p>\r It is now "; /= @time ; _erbout.concat ".\r </p>\r > </body>\r</html>\r"; _erbout > > > ^ > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > unknown regexp options - htl > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > parse error, unexpected $undefined. > _erbout = ''''; _erbout.concat "<html>\r <head>\r <title>Hello, > Rails!</title>\r </head>\r <body>\r <h1>Hello from Rails</h1>\r > <p>\r It is now "; /= @time ; _erbout.concat ".\r </p>\r > </body>\r</html>\r"; _erbout > > > > ^ > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > unterminated string meets end of file > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > parse error, unexpected $, expecting kEND > Extracted source (around line #1): > > 1: <html> > <head> > <title>Hello, Rails!</title> > </head> > <body> > <h1>Hello from Rails</h1> > <p> > It is now <%/= @time %>. > </p> > </body> > </html> > Trace of template inclusion: /app/views/say/hello.rhtml > > RAILS_ROOT: /Users/jim/Documents/work/demo/config/.. > > > Paul Welty wrote: > > Go ahead and paste the contents of your view.html file and also > > copy-and-paste the exact error you''re getting. That will help us find the > > problem. > > > > > > On 11/15/06 8:07 AM, "cmcfarland" <cmcfarland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > Hi, > > > > > > I''ve installed locomotive and all seemed to be fine. The localhost > > > works and I can make a new project and generate controllers, views etc. > > > However as soon as I put some Ruby code in a view html page I get a > > > Syntax Error. Even just trying to use date won''t work. > > > > > > Anyone know where I''m going wrong? I''m keen to get coding! > > > > > > Thanks in advance. > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 11/16/06, cmcfarland <cmcfarland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > hello.rhtml in app/views/say > > <html> > <head> > <title>Hello, Rails!</title> > </head> > <body> > <h1>Hello from Rails</h1> > <p> > It is now <%/= @time %>.Remove the forward slash in this line. ERb tags are <%= %> (output rendered) or <% %> (output not rendered). Matt </p>> </body> > </html> > > say_controller.rb in app/controllers > > class SayController < ApplicationController > def hello > @time = Time.now > end > end > > http://localhost:3000/say/hello > > SyntaxError in Say#hello > > Showing app/views/say/hello.rhtml where line #1 raised: > > compile error > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > unknown regexp option - p > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > parse error, unexpected $undefined. > _erbout = ''''; _erbout.concat "<html>\r <head>\r <title>Hello, > Rails!</title>\r </head>\r <body>\r <h1>Hello from Rails</h1>\r > <p>\r It is now "; /= @time ; _erbout.concat ".\r </p>\r > </body>\r</html>\r"; _erbout > > > ^ > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > unknown regexp options - htl > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > parse error, unexpected $undefined. > _erbout = ''''; _erbout.concat "<html>\r <head>\r <title>Hello, > Rails!</title>\r </head>\r <body>\r <h1>Hello from Rails</h1>\r > <p>\r It is now "; /= @time ; _erbout.concat ".\r </p>\r > </body>\r</html>\r"; _erbout > > > > ^ > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > unterminated string meets end of file > /Users/jim/Documents/work/demo/config/../app/views/say/hello.rhtml:1: > parse error, unexpected $, expecting kEND > Extracted source (around line #1): > > 1: <html> > <head> > <title>Hello, Rails!</title> > </head> > <body> > <h1>Hello from Rails</h1> > <p> > It is now <%/= @time %>. > </p> > </body> > </html> > Trace of template inclusion: /app/views/say/hello.rhtml > > RAILS_ROOT: /Users/jim/Documents/work/demo/config/.. > > > Paul Welty wrote: > > Go ahead and paste the contents of your view.html file and also > > copy-and-paste the exact error you''re getting. That will help us find > the > > problem. > > > > > > On 11/15/06 8:07 AM, "cmcfarland" <cmcfarland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > Hi, > > > > > > I''ve installed locomotive and all seemed to be fine. The localhost > > > works and I can make a new project and generate controllers, views > etc. > > > However as soon as I put some Ruby code in a view html page I get a > > > Syntax Error. Even just trying to use date won''t work. > > > > > > Anyone know where I''m going wrong? I''m keen to get coding! > > > > > > Thanks in advance. > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> It is now <%/= @time %>Seems to be a simple typeing error... See the slash ( / ) you have in front of the " = " ? thats wrong ... the parser seems to see it as ather start of a regular expression pattern, which are usually ecapsulated in slashes .. /pattern/ try: It is now <%= @time %> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---