Error message when launching Sinatra application in Windows Vista
I was reading Adam Case's video tutorial on how to make a url shortening app in Sinatra. The code that is giving me problems is here http://pastie.org/958644
So when I ran it I got this error:
shortener.rb: 12: syntax error, unexpected $ undefined waiting for $ end @@ home
I typed it exactly as Adam said, but it continues. What is the problem?
By the way, I am running ruby 1.9.1p243 (2009-07-16 version 24175) [i386-mingw32] on Windows Vista.
Thanks Adam
I found the answer on IRC # sinatra. The problem was twofold.
-
I had a place after @@ home . As soon as I got rid of this space, I got a new error.
-
New error:
shortener.rb: 8: in: undefined method `use_in_file_templates! 'for main: O bject (NoMethodError)
The reason for this was because the video tutorials I watched were dated and Sinatra is currently at version 1.0. Therefore, the updates for Sinatra are located at:
http://github.com/sinatra/sinatra/blob/1.0/CHANGES#L101
Ultimately I just had to replace the use_in_file_templates method ! using the enable: inline_templates method .