Я пытаюсь перейти с Rails 4.2 на Rails 5.0 (работает на ruby 2.3) (см. План здесь https://stackoverflow.com/a/38443616/7374136)
План:
- Обновите
rails gem
и все зависимости. - Запустите тесты (охватывающие почти всю нашу базу кода) для амортизации и исправьте их.
- Выполните
rake rails:update
до обновите Rails - Адаптация конфигурации, классов приложений, внесение изменений, ...
Тем не менее, на первом этапе я уже заблокирован, обновляя rails gem
и зависимости.gem 'rails', '4.2.5'
-> gem 'rails', '~> 5.0'
running: bundle update rails
.
Я столкнулся с несколькими проблемами с зависимостями, которые я исправил, посмотрев на любые зависимости, которые в конечном счете требуют, чтобы рельсы были меньше 5, и посмотрел, могут ли они бытьВыполняется:
bundle update rails tolk rspec-rails globalize active_model_serializers simple_form postmark-rails > rails_update_report.txt
Я получаю Gemfile следующим образом:
source 'https://rubygems.org'
# ruby '2.3.2'
gem 'bundler', '>= 1.11.2'
#core
gem 'rails', '~> 5.0'
gem 'pg'
gem 'puma'
#rest-client
gem 'httparty'
#rails-extension
gem 'rails-i18n', '~> 4.0', '>= 4.0.8'
gem 'active_model_serializers', '~> 0.10.7'
gem 'devise', '~> 3.5.6'
gem 'devise-i18n'
gem 'devise-i18n-views'
gem 'draper', '~> 2.1.0'
gem 'interactor', '~> 3.1'
gem 'rack-cors', :require => 'rack/cors'
gem 'globalize', '~> 5.1'
gem 'globalize-accessors', '~> 0.2.1'
gem 'kaminari'
gem 'tolk', '~> 3.1'
gem 'reform', '~> 2.1.0'
gem 'reform-rails', '~> 0.1.0'
gem 'virtus', '~> 1.0.5'
gem 'validates_timeliness', '~> 4.0'
gem 'pundit', '~> 1.1.0'
gem 'time_difference'
gem 'phonelib', '~> 0.5.6'
gem 'jwt', '~> 1.5'
gem 'pdf-forms', github: 'jkraemer/pdf-forms', branch: "1.0.0"
gem 'combine_pdf', '~> 0.2.21'
gem 'pdf-reader'
#markdown
gem 'redcarpet'
#files upload and images handling
gem 'carrierwave', '~> 0.11.2'
gem 'fog-aws'
gem 'file_validators'
gem 'mini_magick'
gem 'remotipart'
gem 'carrierwave-imageoptimizer'
gem 'fastimage'
#front
gem 'sass-rails', '~> 5.0'
gem 'uglifier'
gem 'coffee-rails', '~> 4.1.1'
gem 'jquery-rails'
gem 'jquery-cookie-rails'
gem 'foundation-rails'
gem 'slim-rails'
gem 'simple_form', '~> 4.0', '>= 4.0.1'
gem 'cocoon', '~> 1.2.8'
gem 'font-awesome-rails', '~> 4.5'
gem 'jquery-slick-rails'
# gem 'dropzonejs-rails'
# misc
gem 'sentry-raven'
gem 'postmark-rails', '~> 0.18.0'
gem 'chargebee'
gem 'split', require: 'split/dashboard'
# Note that backup is actually a stand alone app packaged as a ruby gem!
gem 'backup', require: false
gem 'whenever', require: false
#Delayed Jobs
gem 'sidekiq'
gem 'sidekiq-client-cli'
group :development, :test do
gem 'quiet_assets'
gem 'rspec-rails', '~> 3.8', '>= 3.8.1'
gem 'factory_girl_rails', require: false
gem 'faker'
gem 'pry-rails'
gem 'pry-rescue'
gem 'bullet'
gem 'active_record_query_trace'
end
group :development do
gem 'better_errors'
gem 'spring'
gem 'spring-commands-rspec'
gem 'binding_of_caller'
gem 'foreman'
gem 'i18n_yaml_sorter'
gem 'capistrano', '~> 3.4', require: false
gem 'capistrano-rails', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano-rbenv', require: false
gem 'capistrano-db-tasks', require: false
gem 'capistrano-maintenance', '~> 1.0', require: false
gem 'airbrussh', require: false
gem 'highline', require: false
gem 'capistrano-faster-assets', require: false
gem 'capistrano-sidekiq', github: 'seuros/capistrano-sidekiq'
end
group :test do
gem 'capybara', require: false
gem 'database_cleaner', require: false
gem 'launchy', require: false
gem 'site_prism', require: false
gem 'memoist'
gem 'rspec-collection_matchers', require: false
gem 'poltergeist', require: false
gem 'selenium-webdriver', require: false
gem 'capybara-screenshot', require: false
gem 'webmock', require: false
gem 'email_spec', require: false
gem 'rspec-sidekiq'
end
И получаю следующую ошибку:
Could not find gem 'rails (~> 5.0)', which is required by gem 'dropzonejs-rails', in any of the sources.
Полный отчетэто:
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies..............
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
postmark-rails (~> 0.18.0) was resolved to 0.18.0, which depends on
actionmailer (>= 3.0.0)
rails (~> 5.0) was resolved to 5.0.0, which depends on
actionmailer (= 5.0.0)
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
active_model_serializers (~> 0.10.7) was resolved to 0.10.7, which depends on
actionpack (< 6, >= 4.1)
draper (~> 2.1.0) was resolved to 2.1.0, which depends on
actionpack (>= 3.0)
kaminari was resolved to 0.16.3, which depends on
actionpack (>= 3.0.0)
rails (~> 5.0) was resolved to 5.0.0, which depends on
actionpack (= 5.0.0)
simple_form (>= 4.0.1, ~> 4.0) was resolved to 4.0.1, which depends on
actionpack (>= 5.0)
slim-rails was resolved to 3.1.1, which depends on
actionpack (>= 3.1)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
globalize (~> 5.1) was resolved to 5.1.0, which depends on
activerecord (< 5.2, >= 4.2)
rails (~> 5.0) was resolved to 5.0.0, which depends on
activerecord (= 5.0.0)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.0)
dropzonejs-rails was resolved to 0.8.2, which depends on
rails (> 3.1)
Could not find gem 'rails (~> 5.0)', which is required by gem 'dropzonejs-rails', in any of the sources.
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (~> 5.0) was resolved to 5.0.0, which depends on
railties (= 5.0.0)
rails-i18n (>= 4.0.8, ~> 4.0) was resolved to 4.0.9, which depends on
railties (~> 4.0)
У меня проблема, с которой я не могу обойтись. Может ли кто-нибудь мне помочь?