无法在Rails中生成回形针迁移4

时间:2014-04-07 18:42:40

标签: ruby-on-rails ruby

使用 gem' paperclip','〜> 3.0' 用于图片上传,运行bundle install& 将关联添加到我的 pins.rb 文件

class Pin < ActiveRecord::Base
    belongs_to :user

    has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }
end

但是当我运行 rails生成回形针图像时,我收到错误消息

/usr/local/rvm/gems/ruby-2.0.0-p247/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:0x007f87d9cffba8> (NoMethodError)
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.4/lib/rails/generators/actions/create_migration.rb:34:in `existing_migration'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:112:in `invoke_with_conflict_check'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/actions/create_file.rb:60:in `invoke!'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.4/lib/rails/generators/migration.rb:36:in `create_migration'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.4/lib/rails/generators/migration.rb:65:in `migration_template'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/paperclip-3.5.2/lib/generators/paperclip/paperclip_generator.rb:16:in `generate_migration'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.4/lib/rails/generators.rb:156:in `invoke'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.4/lib/rails/commands/generate.rb:11:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/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>'

无法找到与错误相关的文件

0 个答案:

没有答案
相关问题