Jett Hsieh
Jett Hsieh

Reputation: 3159

Using grit with Ruby on rails

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?

Upvotes: 0

Views: 592

Answers (1)

Reactormonk
Reactormonk

Reputation: 21730

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

Upvotes: 4

Related Questions