本文介绍了我无法安装回形针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是rails的新手,我需要安装Peperclip()我不能,我已经查看了我能找到的每个教程,但我无法找到错误的位置。我安装了ImageMagick并遵循github的所有指令。
当我跑步时:

I'm new in rails, I need to install Peperclip (https://github.com/thoughtbot/paperclip) and i can't, I have looked every tutorial I can find and I haven't been able to find where is the bug. I installed the ImageMagick and follow all the instruction of github.When I run:

rails generate paperclip club imagen

我得到了这个

/Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/railties-4.0.4/lib/rails/generators/actions/create_migration.rb:13:in `migration_file_name': protected method `migration_file_name' called for #<PaperclipGenerator:0x000001053fbb68> (NoMethodError)
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/railties-4.0.4/lib/rails/generators/actions/create_migration.rb:34:in `existing_migration'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:112:in `invoke_with_conflict_check'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:60:in `invoke!'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/railties-4.0.4/lib/rails/generators/migration.rb:36:in `create_migration'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/railties-4.0.4/lib/rails/generators/migration.rb:65:in `migration_template'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/paperclip-4.1.1/lib/generators/paperclip/paperclip_generator.rb:16:in `generate_migration'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/railties-4.0.4/lib/rails/generators.rb:156:in `invoke'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/railties-4.0.4/lib/rails/commands/generate.rb:11:in `<top (required)>'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
    from /Users/Moski/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/railties-4.0.4/lib/rails/commands.rb:48:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

有人能帮帮我吗?
谢谢

Someone can help me?Thanks

推荐答案

它看起来像 paperclip 。您需要直接从GitHub中获取 paperclip

It looks like an existing issue in paperclip. You would need to source paperclip directly from GitHub.

请参阅

您可以获取来自Github的paperclip 在Gemfile中添加以下行:

You can source paperclip from Github by adding the following line in your Gemfile:

gem 'paperclip', github: 'thoughtbot/paperclip'

-OR -

gem 'paperclip', :git => "git://github.com/thoughtbot/paperclip.git"

这篇关于我无法安装回形针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 20:59