5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ruby/rails のversionを上げた際に Array values in the parameter to `Gem.paths=` are deprecated. エラーが出た時

Posted at

issue

昔に作成したアプリケーションをruby2.4/rails4.7にて動かそうとした時に以下のエラーが発生

Array values in the parameter to `Gem.paths=` are deprecated.
Please use a String or nil.
.
.
.
An Array ({"GEM_PATH"=>["/Users/hogehoge/workspace/old_app/vendor/bundle/ruby/2.4.0"]}) was passed in from bin/rails:3:in `load'
	from /Users/hogehoge/workspace/old_app/bin/spring:13:in `<top (required)>'
	from bin/rails:3:in `load'
	from bin/rails:3:in `<main>'

conclusion

springのbinstubを一旦削除し再作成


$ bundle update spring
$ bundle exec spring binstub --remove --all
$ bundle exec spring binstub --all

4.1からspringが標準で付属する様になったので、bundle updateでspringがinstallされます。
一方で rails new 時とは違いspringのsetup処理がされないままになっていたのが原因の様です。

参考元

rubygems/rubygems:issue 1551

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?