Using grit with Ruby on rails

582 Views Asked by At

When I use rails c, I could type repo = Grit::Repo.name("/path/path") and there is no error.

But when I type these in my rails controller, there is a error message showing: uninitialized constant AaaController::Grit , and if I add require 'grit' , it says no such file to load -- grit.

I am sure that I have added gem 'grit' to my Gemfile and did bundle install.

What's wrong with this?

1

There are 1 best solutions below

1
Reactormonk On BEST ANSWER

Try ::Grit. In 1.9, constant lookup is a bit different.