# Problem using Locomotive

**URL:** <https://www.ruby-forum.com/t/problem-using-locomotive/76042>\
**Category:** Rails\
**Created:** [November 15, 2006, 2:13pm UTC](https://www.ruby-forum.com/t/problem-using-locomotive/76042 "2006-11-15T14:13:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [November 15, 2006, 2:13pm UTC](https://www.ruby-forum.com/t/problem-using-locomotive/76042/1 "2006-11-15T14:13:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [November 15, 2006, 3:50pm UTC](https://www.ruby-forum.com/t/problem-using-locomotive/76042/2 "2006-11-15T15:50:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [November 16, 2006, 12:55pm UTC](https://www.ruby-forum.com/t/problem-using-locomotive/76042/3 "2006-11-16T12:55:32Z")

</div>

hello.rhtml in app/views/say

 Hello, Rails! 
# Hello from Rails

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

say\_controller.rb in app/controllers

class SayController \< ApplicationController  
def hello  
@time = Time.now  
end  
end

[http://localhost:3000/say/hello](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 "\r \r Hello,  
Rails!\r \r \r

# Hello from Rails
\r

\r It is now "; /= @time ; \_erbout.concat ".\r

\r \r\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 "\r \r Hello,  
Rails!\r \r \r

# Hello from Rails
\r

\r It is now "; /= @time ; \_erbout.concat ".\r

\r \r\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:

 Hello, Rails! 
# Hello from Rails

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

 Trace of template inclusion: /app/views/say/hello.rhtml

RAILS\_ROOT: /Users/jim/Documents/work/demo/config/…

---

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [November 16, 2006, 12:57pm UTC](https://www.ruby-forum.com/t/problem-using-locomotive/76042/4 "2006-11-16T12:57:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [November 16, 2006, 1:03pm UTC](https://www.ruby-forum.com/t/problem-using-locomotive/76042/5 "2006-11-16T13:03:34Z")

</div>

On 11/16/06, cmcfarland [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

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

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

Matt

```
</p>

```

---

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [November 16, 2006, 1:05pm UTC](https://www.ruby-forum.com/t/problem-using-locomotive/76042/6 "2006-11-16T13:05:35Z")

</div>

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