小编rAl*_*len的帖子

rails generate dragonfly从Heroku迁移到专用服务器后返回未定义的方法`public_key ='for#<Recaptcha

站点已从Heroku迁移到专用的Ubuntu服务器,并且在迁移站点正常工作之后,除了在S3上托管的映像之外.

当加载带有图像的页面时,将返回以下类型的错误:

Completed 200 OK in 1428.8ms (Views: 505.5ms | ActiveRecord: 322.2ms)
Started GET "/system/images/W1siZiIsIjIwMTYvMDkvMjIvMTMvMjQvMjUvMjE1L05hb21pX1NhbnNvbS5qcGciXSxbInAiLCJ0aHVtYiIsIjM2MHgzNjAjIl1d/picture.jpg" for ip at 2016-11-23 00:27:24 +0000

Dragonfly::Configurable::NotConfigured (You need to configure Dragonfly::DataStorage::S3DataStore with bucket_name):
Run Code Online (Sandbox Code Playgroud)

我可以看到应用程序没有在gemfile中列出蜻蜓,因为Heroku似乎做了一些不同的事情,并重新安装了蜻蜓,但是当试图生成配置文件后,返回错误.

# rails generate dragonfly
appdir/config/initializers/recaptcha.rb:2:in `block in <top (required)>': undefined method `public_key=' for #<Recaptcha::Configuration:0x0000000521f070> (NoMethodError)
        from appdir/vendor/bundle/ruby/2.0.0/gems/recaptcha-4.0.0/lib/recaptcha.rb:30:in `configure'
        from appdir/config/initializers/recaptcha.rb:1:in `<top (required)>'
        from appdir/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:245:in `load'
        from appdir/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:245:in `block in load'
        from appdir/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:236:in `load_dependency'
        from appdir/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:245:in `load'
        from appdir/vendor/bundle/ruby/2.0.0/gems/railties-3.2.18/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
        from appdir/vendor/bundle/ruby/2.0.0/gems/railties-3.2.18/lib/rails/engine.rb:592:in `each'
        from appdir/vendor/bundle/ruby/2.0.0/gems/railties-3.2.18/lib/rails/engine.rb:592:in `block in …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails recaptcha dragonfly-gem

5
推荐指数
1
解决办法
1371
查看次数

标签 统计

dragonfly-gem ×1

recaptcha ×1

ruby-on-rails ×1