Hussein Patwa
2006-Dec-18 06:02 UTC
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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg
2006-Dec-18 11:22 UTC
Re: Parse Errors - Is it the old Windows/UNIX spacing proble
Hussein Patwa 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marek Kralewski
2006-Dec-18 13:28 UTC
Re: Parse Errors - Is it the old Windows/UNIX spacing problem?
Hi Hussein, Am Montag, den 18.12.2006, 07:02 +0100 schrieb Hussein Patwa:> 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 http://www.tuxwerk.de/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hussein Patwa
2006-Dec-18 20:23 UTC
Re: Parse Errors - Is it the old Windows/UNIX spacing proble
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: [CODE] app/controllers/bookings_controller.rb:9: parse error, unexpected kEND, expecting $ RAILS_ROOT: ./script/../config/.. [/CODE] My Controller File: [CODE] class BookingsController < ApplicationController scaffold :booking end def index render_text(''Welcome to StarFlight\''s Booking System'') end end [/CODE] 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: [CODE] <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> [/CODE] 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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---