2016-11-12 4 views
1

を指定したので、私は次のような問題に遭遇した:はあなたのRubyのバージョンは2.3.1ですが、あなたのGemfileは2.3.1(同じバージョン)

Your Ruby version is 2.3.1, but your Gemfile specified 2.3.1

私は私のアプリを展開するときHerokuのは言います。このエラーは、現在のルビーバージョンとGemfileのルビーバージョンとの不一致がある場合にのみ発生します。

あなたは、任意のコードhere

を見ることができます。ここビルド出力です:

remote: -----> Ruby app detected 
remote: -----> Compiling Ruby/Rails 
remote: -----> Using Ruby version: ruby-2.3.1 
remote: -----> Installing dependencies using bundler 1.11.2 
remote:  Ruby version change detected. Clearing bundler cache. 
remote:  Old: ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux] 
remote:  New: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] 
remote:  Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment 
remote:  Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. 
remote:  Your Ruby version is 2.3.1, but your Gemfile specified 2.3.1 
remote:  Bundler Output: Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. 
remote:  Your Ruby version is 2.3.1, but your Gemfile specified 2.3.1 
remote: ! 
remote: !  Failed to install gems via Bundler. 
remote: ! 
remote: !  Push rejected, failed to compile Ruby app. 
remote: 
remote: !  Push failed 
remote: Verifying deploy.... 
remote: 
remote: ! Push rejected to chatisto. 
remote: 

このエラーの原因は何?

答えて

3

woooooow、nasty fail。

は、問題を発見:

rbenv local 2.3.1 を実行するときにrbenvは、このファイルを生成して、私は.ruby-versionのうち、ルビーバージョンをお読みください。このファイルは、バージョン番号の後に改行があります。 "2.3.1\n"を返さ

ruby_version_file = File.expand_path(".ruby-version", __dir__) 
ruby File.read(ruby_version_file) 

File.read(ruby_version_file)ながら...しかし、Herokuの中で、これは見て本当に大変でしたログの構築:

(それhereを修正)私はそれを読むためにこのコードを使用していました。

関連する問題