SFEley/candy

trouble getting candy to load

Opened this issue · 7 comments

`require': /home/matt/.bundle/ruby/1.8/gems/candy-0.2.6/lib/candy/crunch.rb:219: syntax error, unexpected ':', expecting ']' (SyntaxError)
findandmodify: self.collection.name,
^
/home/matt/.bundle/ruby/1.8/gems/candy-0.2.6/lib/candy/crunch.rb:220: syntax error, unexpected ':', expecting '='
query: query,
^
/home/matt/.bundle/ruby/1.8/gems/candy-0.2.6/lib/candy/crunch.rb:221: syntax error, unexpected ':', expecting '='
update: update,
^
/home/matt/.bundle/ruby/1.8/gems/candy-0.2.6/lib/candy/crunch.rb:222: syntax error, unexpected ':', expecting '='
sort: sort

closing, didn't read the 1.9 prerequisite

No worries. If it was just the hash syntax I'd work harder to make it 1.8 compatible, but we're also using 1.9's UTF-8 capabilities and may soon use fibers.

I'm sorry if this makes Candy unusable for a current project you have going. If it's for something new, though, I'd suggest you give 1.9 a shot. Besides a few slick new features, it really is much faster. >8->

not its ok, i've installed rvm and on 1.9.2-head im still getting the error, wondering if my rails command is referencing old ruby

which rails
/home/matt/.rvm/gems/ruby-1.9.2-head/bin/rails
matt@matt-laptop:~/dev/rails/mongo-orm-overview$ rails console
/home/matt/.rvm/gems/ruby-1.9.2-head/gems/candy-0.2.6/lib/candy.rb:3:in `require': /home/matt/.rvm/gems/ruby-1.9.2-head/gems/candy-0.2.6/lib/candy/crunch.rb:219: syntax error, unexpected ':', expecting ']' (SyntaxError)
        findandmodify: self.collection.name,
                      ^
/home/matt/.rvm/gems/ruby-1.9.2-head/gems/candy-0.2.6/lib/candy/crunch.rb:220: syntax error, unexpected ':', expecting '='
        query: query,
              ^
/home/matt/.rvm/gems/ruby-1.9.2-head/gems/candy-0.2.6/lib/candy/crunch.rb:221: syntax error, unexpected ':', expecting '='
        update: update,
               ^
/home/matt/.rvm/gems/ruby-1.9.2-head/gems/candy-0.2.6/lib/candy/crunch.rb:222: syntax error, unexpected ':', expecting '='
        sort: sort
             ^
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/candy-0.2.6/lib/candy.rb:3
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/bundler-0.9.25/lib/bundler/runtime.rb:46:in `require'
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/bundler-0.9.25/lib/bundler/runtime.rb:46:in `require'
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/bundler-0.9.25/lib/bundler/runtime.rb:41:in `each'
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/bundler-0.9.25/lib/bundler/runtime.rb:41:in `require'
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/bundler-0.9.25/lib/bundler/runtime.rb:40:in `each'
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/bundler-0.9.25/lib/bundler/runtime.rb:40:in `require'
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/bundler-0.9.25/lib/bundler.rb:89:in `require'
    from /home/matt/dev/rails/mongo-orm-overview/config/application.rb:10
    from /home/matt/dev/rails/mongo-orm-overview/config/environment.rb:2:in `require'
    from /home/matt/dev/rails/mongo-orm-overview/config/environment.rb:2
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.0.beta3/lib/rails/commands.rb:33:in `require'
    from /home/matt/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.0.beta3/lib/rails/commands.rb:33
    from script/rails:9:in `require'
    from script/rails:9

wondering if my rails command is referencing old ruby

That would be my guess, since what it's choking on is just the new 1.9 hash syntax. Try removing candy from your Gemfile (so that you can load the console) and then, in the Rails console, do:

puts RUBY_VERSION

thanks for you help, got it up and running

Glad to hear it! Let me know how it goes for you.