Ruby on rails gravatar_image_tag

I follow the guide railstutorial.org. Although I can see gravatar on the webpage, my rspec test does not work.

Here is the user_controller_spec.rb test:

describe "GET 'show'" do

  before(:each) do
    @user = Factory(:user)
  end

  it "should be successful" do
    get :show, :id => @user
    response.should be_success
  end

end

Here is the corresponding show.html.erb file:

<table class="profile" summary="Profile information">
  <tr>
    <td class="main">
      <h1>
        <%= gravatar_image_tag(@user.email) %>
        <%= @user.name %>
      </h1>
    </td>
    <td class="sidebar round">
      <strong>Name</strong> <%= @user.name %><br />
      <strong>URL</strong> <%= link_to user_path(@user), @user %>
    </td>
  </tr>
</table>

I get the error "undefined method" gravatar_image_tag ". I already installed the corresponding stone by doing" gem install gravatar_image_tag ", adding it to my gemfile, and also doing" bundle install ". It is listed as installed when I run the" gem list "

I am trying to debug this for several hours. Any help would be greatly appreciated. Thanks in advance. BTW, I am running 32-bit Windows 7 with GIT Bash, RubyInstaller-1.9.2-p0.

Error message:

alt text

+3
6

gravatar_image_tag gem gemfile? group :development, :production - , .

, :

get :show, :id => @user

, :

get :show, :id => @user.id

+1

, undefined method 'gravatar_image_tag', ( Gemfile, ).

(Ctrl C then rails server), .

+19

. github http://github.com/mdeering/gravatar_image_tag/issues . , .

, gemcutter, .

Cheers, ..

+1

Spork DRB, , ! ( Hartls PDF).

+1

, .

+1

PDF.

gem 'gravatar_image_tag'

Gemfile, rails,

rails s

.

0

Source: https://habr.com/ru/post/1769686/


All Articles