2016-08-15 5 views
0

現在、私のRoRアプリケーションを5.0.0から4.2.1にダウングレードしようとしています。 5.0.0でうまく動作します。RoRを5.0.0から4.2.1にダウングレードする:未定義のメソッド `to_time_preserves_timezone = 'for ActiveSupport:Module

ソース「https://rubygems.org

:これは私のGemfileのように見えるものである

undefined method `to_time_preserves_timezone=' for ActiveSupport:Module 

移行:

はしかし、私はすくいデシベルを行う場合、残念ながら本当に多くの私に教えてくれない、このエラーが出ます

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.1' # Postgress gem 'pg' # Authentication gem 'devise' # Use activeadmin for administration gem 'activeadmin', github: 'activeadmin' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Slim support gem "slim-rails" # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.1.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 3.0' # Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' # Use Bootstrap forms gem 'bootstrap_form' # gem 'capistrano-rails', group: :development gem 'rails_12factor', group: :production group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug' # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end 

大変ありがとうございます。

答えて

1

まずは... ... yikes。ダウングレードは決して楽しいものではありません。

gem listとなり、activesupportのバージョンが表示されます。 Rails 4.2.1には、以前のバージョンactivesupport 4.2.1と、他の宝石の束が必要です。

その後、適切なバージョンが取得されるため、Gemfile.lockbundle installを削除してください。私はこれが乱雑になることを保証しますが、コアレールの宝石類は最低でもダウングレードしなければなりません。

編集:プロジェクトにRails 5.0の依存関係があり、ロールバック処理が中断することも考えられますので、問題が完全に解決されないこともあります。それは試してみる価値がある。

+0

ありがとう、これは良いアイデアでした。 – patrick

4

Gemfile.lockを削除して 'bundle install'を実行すると、バージョンが指定されていない限り、gemfileで書かれた最近のバージョンのgemがインストールされます。バージョン4.2.1との互換性の問題が発生する可能性があります。

これは、Rails 5.0のグラデーションのために発生した問題です。プロジェクトディレクトリにRails 5をサポートする設定ファイルが含まれていないことを確認してください。

0

私はconfig/initializers/new_framework_defaults.rbをコメントアウトしてこの問題を解決しました。そのファイルはRails 5の一部です。その後はすべてがうまくいくように見えました。

関連する問題