【发布时间】:2012-04-15 12:43:18
【问题描述】:
自从我从 Rails 3.0 迁移到 Rails 3.1 后,我收到以下警告:
弃用警告:class_inheritable_attribute 已弃用,请 改用 class_attribute 方法。注意他们的行为是轻微的 不同,所以请先参考 class_attribute 文档。 (称为 从要求在 /Users/vincentdaubry/.rvm/gems/ruby-1.9.2-p318@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:74)
我的代码中没有对 class_inheritable_attribute 的任何引用。
我猜我正在使用的其中一个 gem 产生了这个错误,但我怎么知道是哪一个?或者还有什么办法可以解决这个警告?
编辑 2:
我使用的 gem 没有任何对 class_inheritable_attribute 的引用(我试图在 gem 目录中确认“class_inheritable_attribute”)。
如果我将我的应用程序部署在另一台不使用 RVM 的 rails 3.1.3 计算机上,我不会收到警告,所以我认为它来自 RVM。听起来合理吗? 我尝试使用 rvm get stable 更新 RVM,但我仍然收到警告..
有什么想法吗?
编辑:
这是我的 gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'paperclip', '2.4.5'
gem 'pdf-toolkit', '0.5.0'
gem 'omniauth-facebook', '1.2.0'
gem 'delayed_job', '2.1.4'
gem 'devise', '1.5.3'
gem 'mini_magick', '3.4'
gem 'faraday', '0.6.1' #WARNING : this faraday version is specify, because on 0.7.5 this breaks facebook connection
gem 'acts-as-taggable-on', '2.2.2'
gem 'kaminari', '0.13.0'
gem 'forem', :git => "git://github.com/radar/forem.git"
gem 'forem-redcarpet', :git => "git://github.com/radar/forem-redcarpet"
gem 's3_swf_upload', :git => 'https://github.com/nathancolgate/s3-swf-upload-plugin.git'
gem 'aws-s3', '0.6.2', :require => 'aws/s3'
gem 'jquery-rails', '1.0.13'
gem 'dalli', '1.1.4'
gem 'bson', '1.5.2'
gem 'bson_ext', '1.5.2'
gem 'exception_notification_rails3', '1.2.0', :require => 'exception_notifier'
######################################################################
# unused
######################################################################
#gem 'newrelic_rpm', '3.3.1'
#gem 'mongo', '1.5.2'
#gem 'mongoid', '2.4.0'
#gem "rdiscount"
######################################################################
# Environment specific
######################################################################
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'mocha'
end
group :production do
gem "pg"
end
谢谢, 文森特
【问题讨论】:
-
bundler-1.1.3 导致警告,发布您的 Gemfile
-
我认为 bundler 只是在我的一个 gem 中检测到一些弃用(?)我用我的 gemfile 的副本编辑了我的问题
-
你说得对,我没有看到'require'
-
尝试“捆绑更新”,它会重新加载所有的 gem,看看你是否看到弃用警告。
-
等等,没关系,它会将 gem 更新到最新版本,抱歉
标签: ruby-on-rails ruby-on-rails-3.1