现在我将在localhost上安装并运行一个小型Rails 5应用程序。 我成功完成了“捆绑安装”和“rake db:create”。 然后,当我执行“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 /mnt/c/workspace/c3church.ca/config/application.rb:7)
rake aborted!
NoMethodError: undefined method `+' for nil:NilClass
/mnt/c/workspace/c3church.ca/config/initializers/paperclip.rb:3:in `<top (required)>'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:287:in `load'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:287:in `block in load'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:287:in `load'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/engine.rb:648:in `block in load_config_initializer'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/notifications.rb:166:in `instrument'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/engine.rb:647:in `load_config_initializer'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/engine.rb:611:in `each'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/engine.rb:611:in `block in <class:Engine>'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/initializable.rb:30:in `instance_exec'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/initializable.rb:30:in `run'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/initializable.rb:44:in `each'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/initializable.rb:44:in `tsort_each_child'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/initializable.rb:54:in `run_initializers'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/application.rb:352:in `initialize!'
/mnt/c/workspace/c3church.ca/config/environment.rb:5:in `<top (required)>'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:in `require'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:in `block in require'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/prince/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:in `require'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/application.rb:328:in `require_environment!'
/home/prince/.rvm/gems/ruby-2.3.3/gems/railties-5.0.7/lib/rails/application.rb:448:in `block in run_tasks_blocks'
/home/prince/.rvm/gems/ruby-2.3.3/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/prince/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `eval'
/home/prince/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
我的Gemfile是:
source 'https://rubygems.org'
gem 'rails', '~> 5.0.0'
gem 'sprockets-rails', :require => 'sprockets/railtie'
gem 'sass-rails'
gem "uglifier", "~> 3.0.0"
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'
gem 'cancancan'
gem 'devise'
gem 'figaro'
gem 'rolify'
gem 'simple_form'
gem 'paperclip'
gem 'aws-sdk', '~> 2.3.0'
gem 'aws-sdk-resources', '~> 2'
gem 'jquery-ui-rails'
gem 'jquery-timepicker-addon-rails'
gem "geocoder"
gem "font-awesome-rails"
gem "jquery-slick-rails"
gem 'truncate_html'
gem "instagram-continued", require: "instagram"
gem 'fancybox2-rails'
gem 'validates_email_format_of'
gem 'icalendar', '~> 2.3'
gem 'responders', '~> 2.0'
gem 'react-rails'
gem 'shrine'
gem 'jquery-fileupload-rails'
group :development do
gem 'sqlite3'
gem 'better_errors'
gem 'binding_of_caller', :platforms=>[:mri_19, :mri_20, :rbx]
gem 'rails_layout'
gem 'rb-fchange', :require=>false
gem 'rb-fsevent', :require=>false
gem 'rb-inotify', :require=>false
gem 'guard-bundler'
gem 'guard-rails'
gem 'guard-rspec'
gem 'guard-livereload', '~> 2.4', require: false
gem 'web-console', '~> 2.0'
gem 'byebug'
gem 'rails_real_favicon'
end
group :development, :test do
gem 'factory_girl_rails'
gem 'rspec-rails'
gem 'thin'
gem 'rb-readline'
end
group :test do
gem 'capybara'
gem 'database_cleaner', '1.0.1'
gem 'email_spec'
end
group :production do
gem 'puma'
gem 'heroku-deflater'
gem 'pg'
#gem 'rails_12factor'
#gem 'newrelic_rpm'
end
#ruby=2.3.3
ruby '2.3.3'
config / initializers / paperclip.rb文件是:
Paperclip::Attachment.default_options[:url] = ':s3_alias_url'
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
Paperclip::Attachment.default_options[:s3_host_alias] = ENV['S3_BUCKET_NAME']+'.s3.amazonaws.com'
Paperclip.options[:command_path] = '/usr/bin'
您能否告诉我原因以及如何解决? 非常感谢你。
答案 0 :(得分:0)
nil
返回s3
。您必须将环境变量设置为"My-Bucket-Name"
存储桶名称。您可以选择删除该变量并传入类似<a-scene>
<a-sky id="ou" material="opacity:1; src: ./3D/letras/Horizonte.jpg" foo>
<a-animation id="fadeout-animation" attribute="material.opacity" dur="1000" direction="forward" from="1" to="0" begin="fadeout"></a-animation>
<a-animation id="fadein-animation" attribute="material.opacity" dur="1000" direction="forward" from="0" to="1" begin="fadein"></a-animation>
</a-sky>
<!--<a-sky material="opacity:1; src: ./3D/letras/Horizonte.jpg" foo></a-sky>-->
</a-scene>
的字符串。