У меня есть проект Rails (4.2.6
), который был написан с использованием ruby 2.2.0
.
Я пытаюсь перейти на ruby 2.5
.Для этого я изменил в репозитории Rails файл .ruby-version
на ruby-2.5.0
.
В терминале версия ruby верна:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
Когда я запускаю
bundle update --bundler
Я получаю следующую ошибку:
6 warnings and 2 errors generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/albert/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/json-1.8.3 for inspection.
Results logged to /Users/albert/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/json-1.8.3/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
In Gemfile:
rails was resolved to 4.2.6, which depends on
actionmailer was resolved to 4.2.6, which depends on
actionpack was resolved to 4.2.6, which depends on
actionview was resolved to 4.2.6, which depends on
rails-dom-testing was resolved to 1.0.7, which depends on
rails-deprecated_sanitizer was resolved to 1.0.3, which depends on
activesupport was resolved to 4.2.6, which depends on
json
Я пытался вручную обновить гем json:
gem install json -v '1.8.3'
Без успеха:
Getting SRV record failed: DNS result has no information for _rubygems._tcp.gems.rubyforge.org
HEAD http://gems.rubyforge.org/api/v1/dependencies
301 Moved Permanently
HEAD https://rubygems.org
200 OK
Getting SRV record failed: DNS result has no information for _rubygems._tcp.gems.github.com
HEAD http://gems.github.com/api/v1/dependencies
301 Moved Permanently
HEAD http://gems.github.io/api/v1/dependencies
404 Not Found
GET http://gems.github.com/prerelease_specs.4.8.gz
301 Moved Permanently
GET http://gems.github.io/prerelease_specs.4.8.gz
404 Not Found
GET http://gems.github.com/specs.4.8.gz
301 Moved Permanently
GET http://gems.github.io/specs.4.8.gz
404 Not Found
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://rubygems.org?gems=json
200 OK
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
На данный момент я не знаю, что гуглить, как отлаживать.
Если я запускаю
bundle install
Я получаю следующую ошибку
2: from ./bin/bundle:3:in `<main>'
1: from /Users/albert/.rbenv/versions/2.5.0/lib/ruby/2.5.0/rubygems.rb:263:in `bin_path'
/Users/albert/.rbenv/versions/2.5.0/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': Could not find 'bundler' (1.14.3) required by your /Users/albert/localDocuments/CodingArea/Clients/hanspeter/book/Gemfile.lock. (Gem::GemNotFoundException)
To update to the lastest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.14.3`
Не уверен, что это значит, что у меня в Gemfile.lock
есть:
bundler (>= 1.3.0, < 2.0)
И, я мой Gemfile, у меня в качестве источника:
source 'https://rubygems.org'
```
As far as I understood, bundle is a gem manager that works on Mac, and bundler is a gem that manages gems?