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.
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.
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:
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.