Parse Errors - Is it the old Windows/UNIX spacing problem?

I’m getting this error:

SyntaxError
app/controllers/bookings_controller.rb:8: parse error, unexpected
tIDENTIFIER, expecting ‘)’
render_text(‘Welcome to StarFlight’s Bookings!’)
^
app/controllers/bookings_controller.rb:8: unterminated string meets end
of file
app/controllers/bookings_controller.rb:8: parse error, unexpected $,
expecting kEND
RAILS_ROOT: ./script/…/config/…

This error occured while loading the following files:
./script/…/config/…/app/controllers/bookings_controller.rb
Request
Parameters: None

The fcontroller file:
class BookingsController < ApplicationController

scaffold :booking
end

def index
render_text(‘Welcome to StarFlight’s Bookings!’)
end
end

Is this just an issue with Windows putting extra symbols in? I’m using
notepad to write the files.Oddly the other two controllers that I have,
that don’t have a text rendering method, work fine.

I’m using http://localhost:3000/bookings to load the controller.
http://localhost:3000/bookings#index does the same

Hussein.

Hussein P. wrote:

Is this just an issue with Windows putting extra symbols in? I’m using
notepad to write the files.Oddly the other two controllers that I have,
that don’t have a text rendering method, work fine.

Try replacing any tabs with spaces. That will likely solve your
problems.

It really is an iffy issue on Windows. It seems to have to do with
libraries that have been compiled with different (versions of) C
compilers. Avoid tabs and adopt the double space best practice, and you
should be fine though.

  • Roderick

Hi Hussein,

Am Montag, den 18.12.2006, 07:02 +0100 schrieb Hussein P.:

render_text(‘Welcome to StarFlight’s Bookings!’)

You should escape the single ticks:

render_text(‘Welcome to StarFlight's Bookings!’)

  • Marek


marek kralewski
tuxwerk ohg
baslerstr 13
d-79100 freiburg
fon +49 (0)761 7043067
fax +49 (0)761 7043066
mobil +49 (0)171 4644052

Hi.

I loaded up Crimson Editor, set to replace tabs with spaces and save
files in UNIX format, then re-wrote the whole Controller file. I’m
still getting the error:

app/controllers/bookings_controller.rb:9: parse error, unexpected kEND, 
expecting $
RAILS_ROOT: ./script/../config/..

My Controller File:

class BookingsController < ApplicationController
  scaffold :booking
end

def index
  render_text('Welcome to StarFlight\'s Booking System')
end

end

A few of my lecturers at the Uuniversity use Crimson Editor, they don’t
seem to ever have problems with it.

Just in case it helps, my bookings view file:

<html>
<head>
  <title>bookings: <%= controller.action_name %></title>
  <%= stylesheet_link_tag 'scaffold' %>
</head>
<body>

<p style="color: green"><%= flash[:notice] %></p>

<%= index %>

<%= yield  %>

</body>
</html>

Thanks for your help and sorry for this constant pestering. I don’t
have the luxury of just going through a book building simple Hello
World! apps and working up from that, unortunately, so I’m learning as I
go.

Hussein.