我想5應用程序推導軌Heroku的,我相信我也跟着Heroku的頁面上的說明: https://devcenter.heroku.com/articles/ruby-versionsHeroku的版本沒有設置,儘管下面的指南
$ ruby --version
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
$ cat Gemfile
.....
ruby "2.3.1"
$ heroku run bash
$ env | grep PATH
PATH=/app/bin:/usr/local/bin:/usr/bin:/bin
$ git push heroku master
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
與錯誤終止:
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: rake aborted!
remote: NoMethodError: undefined method `symbolize_keys' for # <String:0x007fac0655feb0>
remote: /tmp/build_39bfaebc9acd5a6bcb91a69f2b13c171/vendor/bundle/ruby/2.2.0/gems /railties-5.0.0.1/lib/rails/application.rb:393:in `secrets'
我猜這是因爲它使用2.2而不是2.3。
/bin中的版本是1.9.3,所以萬一找不到,應該使用1.9.3而不是2.2.4。
上面的錯誤消息是在spickermann的幫助下修復的。從git跟蹤中移除secret.yml文件可以讓應用程序無錯地部署。
不過,錯的Ruby版本仍然存在,而Heroku的什末返回警告:
remote: ###### WARNING:
remote: You have not declared a Ruby version in your Gemfile.
remote: To set your Ruby version add this line to your Gemfile:
remote: ruby '2.2.4'
remote: # See https://devcenter.heroku.com/articles/ruby- versions for more information.
大約還有什麼可以做什麼建議?
謝謝!
我忘了提及bin/bundle與指南中所述完全相同 – shaolintl
$ bundler --version Bundler版本1.13.6 – shaolintl