我正在考虑更新这个庞大的网站。它是巨大的。它使用Ruby1.9.3-p448、Rails3.2.17和Spree2.0.0我想把它推到Ruby 2.1.1、Rails 4.1-stable和Spree 2.1.0。
第一件事:
我去了gemfile,在第2行写了ruby '2.1.1'
这是要做的第一件事:升级语言本身。在终端,我做了通常的bundle
操作,结果出错了。发现调试器gem在2.x区域中不工作。突出显示推式删除。笑了。运行bundle
。很高兴地笑了,因为很高兴看到所有的事情都在这样一个复杂的系统中工作。
然后我运行bundle exec rake db:test:prepare
。
第一个错误:
rake aborted!
cannot load such file -- iconv
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/polyglot-0.3.4/lib/polyglot.rb:65:in `require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/polyglot-0.3.4/lib/polyglot.rb:65:in `require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:251:in `block in require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:251:in `require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/csv_builder-2.1.0/lib/csv_builder.rb:14:in `<top (required)>'
/Users/benamorgan/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in `each'
/Users/benamorgan/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in `block in require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `each'
/Users/benamorgan/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler.rb:131:in `require'
/Users/benamorgan/Sites/not_getting_name_of_site/config/application.rb:7:in `<top (required)>'
/Users/benamorgan/Sites/not_getting_name_of_site/Rakefile:5:in `require'
/Users/benamorgan/Sites/not_getting_name_of_site/Rakefile:5:in `<top (required)>'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
好啊。。。在gemfile中。。。
gem 'iconv'
在a
bundle exec rake db:test:prepare
之后再次运行bundle
:Digest::Digest is deprecated; use Digest
rake aborted!
no implicit conversion of nil into String
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/mysql2-0.3.13/lib/mysql2/client.rb:58:in `connect'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/mysql2-0.3.13/lib/mysql2/client.rb:58:in `initialize'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/model_schema.rb:224:in `table_exists?'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activerecord/lib/active_record/attribute_methods.rb:122:in `attribute_method?'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/spree-9c3a61024d8c/core/lib/spree/core/delegate_belongs_to.rb:40:in `block in delegate_belongs_to'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/spree-9c3a61024d8c/core/lib/spree/core/delegate_belongs_to.rb:39:in `each'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/spree-9c3a61024d8c/core/lib/spree/core/delegate_belongs_to.rb:39:in `delegate_belongs_to'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/spree-9c3a61024d8c/core/app/models/spree/gateway.rb:3:in `<class:Gateway>'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/spree-9c3a61024d8c/core/app/models/spree/gateway.rb:2:in `<module:Spree>'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/spree-9c3a61024d8c/core/app/models/spree/gateway.rb:1:in `<top (required)>'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/zeus-0.13.3/lib/zeus/load_tracking.rb:50:in `load'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/zeus-0.13.3/lib/zeus/load_tracking.rb:50:in `load'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:469:in `block in load_file'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:639:in `new_constants_in'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:468:in `load_file'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:353:in `require_or_load'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:502:in `load_missing_constant'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:192:in `block in const_missing'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:190:in `each'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:190:in `const_missing'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/spree-9c3a61024d8c/core/lib/spree/core/engine.rb:59:in `block in <class:Engine>'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/initializable.rb:30:in `instance_exec'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/initializable.rb:30:in `run'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/initializable.rb:54:in `each'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/initializable.rb:54:in `run_initializers'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/application.rb:136:in `initialize!'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/benamorgan/Sites/not_getting_name_of_site/config/environment.rb:5:in `<top (required)>'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/polyglot-0.3.4/lib/polyglot.rb:65:in `require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/gems/polyglot-0.3.4/lib/polyglot.rb:65:in `require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:251:in `block in require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/activesupport/lib/active_support/dependencies.rb:251:in `require'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/application.rb:103:in `require_environment!'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bundler/gems/rails-a3bda3846737/railties/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/benamorgan/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:test:prepare => db:abort_if_pending_migrations => environment
(See full trace by running task with --trace)
我的问题不是怎么解决这个问题,也不是为什么它都坏了,但是你有什么建议吗?我如何找出
Digest::Digest
的来源?我们没有在网站上使用它,因此这是一个宝石的问题。我可能需要处理更多的“贬低”警告,所以在我花上几个小时去做之前,我只需要知道是否有人必须经历我现在正在尝试的任何事情。非常欣赏恐怖故事。
最佳答案
我不认为文摘是你问题的原因MySQL似乎无法正确连接到数据库您确定您的config/database.yml
设置适合您当前的环境吗?
我不确定,但如果错误指向directly at this line,那么我最好的猜测是您的数据库在config/database.yml
中配置错误。
关于ruby-on-rails - 如何更新Ruby,Rails和Spree:请一些指针?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22393035/