Problem using Locomotive

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.

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.

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:

Thankyou - Any help appreciated. I can't get past this error.

cmcfarland wrote:

hello.rhtml in app/views/say

Hello, Rails!

Hello from Rails

 It is now <%/= @time %>.

Remove the forward slash in this line. ERb tags are <%= %> (output rendered) or <% %> (output not rendered).

Matt

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