【问题标题】:Is rails reporting its own action as deprecated?Rails 是否将其自己的操作报告为已弃用?
【发布时间】:2012-04-10 15:07:27
【问题描述】:

对不起,如果这是一个愚蠢的问题,但问题很简单。如果我这样做,

$ rails new testproj
$ cd testporj
$ rails plugin install git://github.com/technoweenie/attachment_fu.git

应该只创建一个空项目并在其中安装附件_fu。但是,尝试启动它:

$ rails s
=> Booting WEBrick
=> Rails 3.2.2 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed
in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and conf
ig/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails
-3-2-0-rc2-has-been-released. (called from <top (required)> at c:/Users/fgadotti/rails/apps/blobtest/testproj/confi
g/environment.rb:5)
Exiting

见鬼?我错过了什么? 它是我安装的 windows 上的 rails 3.2.2。

谢谢,

【问题讨论】:

  • attachment_fu 在 rails 3 上没有得到很好的支持。使用carrierwave
  • 认真的吗?好吧..这些都是浪费时间.. -_-
  • @DanS 哦,顺便说一句,carrierwave 似乎无法将 DB 用作存储,是吗?还有其他可以做到的插件推荐吗?
  • 是的,但是 heroku 不会同意 :(

标签: ruby-on-rails ruby-on-rails-plugins attachment-fu


【解决方案1】:

plugin install 将在 rails 4 中被弃用。

现在首选 Gem,将其添加到应用程序根目录中的 Gemfile 并与 bundle install 一起安装

rails 3 不太支持attachment_fu,我会改用carrierwave。您可以使用 Rmagick 的to_blob 方法将图像存储在数据库中。

【讨论】:

【解决方案2】:

就像错误提示需要一个新的 rails 版本:

确保将 gemfile 添加到最新版本并运行

rake rails:update

这是一回事,警告建议您需要将依赖项移出供应商并将它们放入您的 gemfile 中,然后运行:

bundle install

【讨论】:

  • 对.. 但是,整个事情不应该是一致的吗?我的意思是,这个版本的rails不应该与其自己的标准保持一致吗? (我的意思是,plugin install 需要在安装后立即修复)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-02-22
  • 1970-01-01
  • 2021-10-20
  • 1970-01-01
  • 2016-10-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多