gpt4 book ai didi

ruby-on-rails - 我无法安装回形针

转载 作者:行者123 更新时间:2023-12-04 10:04:09 24 4
gpt4 key购买 nike

我是 Rails 的新手,我需要安装 Peperclip ( https://github.com/thoughtbot/paperclip ) 但我不能,我已经查看了我能找到的所有教程,但我一直无法找到错误在哪里。我安装了 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>'

有人可以帮助我吗?
谢谢

最佳答案

看起来像 paperclip 中存在的问题.您需要来源 paperclip直接来自 GitHub。

请参阅 Paperclip 中的此未解决问题

您可以来源paperclip从 Github 中通过在 Gemfile 中添加以下行:

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

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

关于ruby-on-rails - 我无法安装回形针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22739370/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com