undefined method 'paginate'
<p>I am trying to use will_paginate gem but getting this error in title.
I checked the thread below and did the changes but no luck</p>

<pre><code>http://stackoverflow.com/questions/17105715/undefined-method-paginate
</code></pre>

<p>This is what i have </p>

<p>App/Controllers/books_controller.rb</p>

<pre><code>class BooksController &lt; ApplicationController
    def index
    #@books = Book.all
    @books = Book.paginate :page =&gt; params[:page], :per_page =&gt; 10
    end
end
</code></pre>

<p>index.html.erb:</p>

<pre><code>&lt;%= will_paginate @books %&gt;
</code></pre>

<p>GemFile</p>

<pre><code>gem 'will_paginate', '~&gt; 3.0.4'
</code></pre>

<p>Enbironment.rb</p>

<pre><code>gem 'will_paginate'
</code></pre>

<p>and this is the error i get:</p>

<pre><code>undefined method `paginate' for #&lt;Class:0x007fd539118a30&gt;
</code></pre>