Callum Flack
Callum Flack

Reputation: 407

sinatra app on localhost via unicorn: syntax error

I have a Sinatra app that I continually upgrade (local only, at the moment). Problem being that I know nothing at all about Ruby — my friend made me the app and it's worked beautifully for over almost a year.

To see the site on localhost, I do this:

bundle exec unicorn -l 9000

I don't understand this, haven't needed to. I know I'm using the unicorn gem to run the app directed at port 9000 (due to an old printer conflict).

Today, I get this error:

in `evaluate': compile error (SyntaxError)
syntax error, unexpected ':', expecting $end

which refers to line 16 of my gem file, the sinatra-contrib gem:

gem "sinatra-contrib", require: "sinatra/reloader"

I've never had this error before. Haven't ever touched the gem file, and it's been working for a year. The only thing I can think I've done recently that may have affected my environment is installing a gemset called Wordless:

rvm use 1.8.7@wordless --create --default && gem install therubyracer sprockets compass coffee-script thor yui-compressor && rvm wrapper 1.8.7@wordless wordless compass ruby

I'd appreciate insights, and hopefully I can start to learn a thing or two about managing ruby gems. Thanks.

Upvotes: 0

Views: 214

Answers (1)

Casper
Casper

Reputation: 34308

You were using Ruby 1.9 before. The line you referenced is in 1.9 format, which Ruby 1.8 does not understand.

When you installed Wordless you said:

rvm use 1.8.7@wordless --create --default

This made Ruby 1.8.7 your default interpreter. To switch back to whatever you used before do:

rvm list rubies

And then:

rvm use [the 1.9.x you found in the list above] --default

Upvotes: 2

Related Questions