我无法安装回形针

时间:2014-03-30 01:57:07

标签: ruby-on-rails ruby-on-rails-4 imagemagick paperclip

我是rails的新手,我需要安装Peperclip(https://github.com/thoughtbot/paperclip)而且我不能,我已经找到了我能找到的每个教程而且我还没有能够找到bug的位置。我安装了ImageMagick并遵循github的所有指令。 我跑的时候:

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>'
有人可以帮帮我吗? 感谢

1 个答案:

答案 0 :(得分:16)

它看起来像paperclip中的现有问题。您需要直接从GitHub中获取paperclip

请参阅Paperclip

中的这个未解决的问题

您可以通过在Gemfile中添加以下行从Github中获取paperclip

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

-OR -

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