Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top