当我尝试运行 rake db:migrate 时,出现以下错误:
DEPRECATION WARNING: The factory_girl gem is deprecated. Please upgrade to factory_bot. See https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md for further instructions. (called from <top (required)> at /var/www/html/sophy_web/config/application.rb:14)
/root/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionpack-4.2.8/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant Mime::PDF
/root/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionpack-4.2.8/lib/action_dispatch/http/mime_type.rb:163: warning: previous definition of PDF was here
rake aborted!
NoMethodError: undefined method `>' for nil:NilClass
/var/www/html/application/config/initializers/rollbar.rb:2:in `<top (required)>'
/var/www/html/application/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
我正在使用ruby 2.5.1版和rails 4.2.8。
我的rollbar.rb的代码:
require 'rollbar/rails'
Rollbar.configure do |config|
config.access_token = '9234902384023843203fsd23'
# Here we'll disable in 'test':
if Rails.env.test?
config.enabled = false
end
end
我的环境代码。rb
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!