【发布时间】:2016-05-03 11:52:21
【问题描述】:
我最近在将我的应用程序部署到 heroku 时注意到,由于 ruby 版本,devise gem 似乎让我有些悲伤。我已经尝试降低设计版本 3.9 但这仍然没有解决它
-----> Using set buildpack heroku/ruby
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using bundler 1.11.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 11.1.2
Installing aasm 4.10.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using rack 1.6.4
Using mime-types-data 3.2016.0221
Using arel 6.0.3
Using execjs 2.6.0
Using bcrypt 3.1.11
Using tilt 2.0.2
Using highline 1.7.8
Using sexp_processor 4.7.0
Using safe_yaml 1.0.4
Using sass 3.4.22
Using temple 0.7.6
Using terminal-table 1.5.2
Using cancancan 1.13.1
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.1
Using dalli 2.7.6
Using orm_adapter 0.5.0
Installing geocoder 1.3.4
Using jwt 1.5.4
Using kgio 2.10.0
Using memcachier 0.0.2
Using multi_json 1.11.2
Using pg 0.18.4
Installing puma 3.4.0 with native extensions
Using bundler 1.11.2
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using rolify 5.1.0
Using tzinfo 1.2.2
Installing braintree 2.60.0
Using nokogiri 1.6.7.2
Using rack-test 0.6.3
Using warden 1.2.6
Using mime-types 3.0
Using autoprefixer-rails 6.3.6
Using uglifier 3.0.0
Using haml 4.0.7
Using ruby_parser 3.8.1
Using slim 3.0.6
Using coffee-script 2.4.1
Installing sprockets 3.6.0
Using twilio-ruby 4.11.1
Using rails_12factor 0.0.3
Using activesupport 4.2.4
Using loofah 2.0.3
Using mail 2.6.4
Using material_design_lite-sass 1.1.3
Using ruby2ruby 2.3.0
Using html2haml 2.0.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemerchant 1.58.0
Using activemodel 4.2.4
Using rails-html-sanitizer 1.0.3
Using brakeman 3.2.1
Using rails-dom-testing 1.0.7
Using activejob 4.2.4
Using activerecord 4.2.4
Using actionview 4.2.4
Using friendly_id 5.1.0
Using pg_search 1.0.5
Using actionpack 4.2.4
Using actionmailer 4.2.4
Using railties 4.2.4
Using kaminari 0.16.3
Using sprockets-rails 3.0.4
Using coffee-rails 4.1.1
Using responders 2.1.2
Using jquery-rails 4.1.1
Using rails 4.2.4
Using sass-rails 5.0.4
Installing devise 4.0.0
Gem::InstallError: devise requires Ruby version >= 2.1.0.
An error occurred while installing devise (4.0.0), and Bundler cannot continue.
Make sure that `gem install devise -v '4.0.0'` succeeds before bundling.
Bundler Output: Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 11.1.2
Installing aasm 4.10.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using rack 1.6.4
Using mime-types-data 3.2016.0221
Using arel 6.0.3
Using execjs 2.6.0
Using bcrypt 3.1.11
Using tilt 2.0.2
Using highline 1.7.8
Using sexp_processor 4.7.0
Using safe_yaml 1.0.4
Using sass 3.4.22
Using temple 0.7.6
Using terminal-table 1.5.2
Using cancancan 1.13.1
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.1
Using dalli 2.7.6
Using orm_adapter 0.5.0
Installing geocoder 1.3.4
Using jwt 1.5.4
Using kgio 2.10.0
Using memcachier 0.0.2
Using multi_json 1.11.2
Using pg 0.18.4
Installing puma 3.4.0 with native extensions
Using bundler 1.11.2
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using rolify 5.1.0
Using tzinfo 1.2.2
Installing braintree 2.60.0
Using nokogiri 1.6.7.2
Using rack-test 0.6.3
Using warden 1.2.6
Using mime-types 3.0
Using autoprefixer-rails 6.3.6
Using uglifier 3.0.0
Using haml 4.0.7
Using ruby_parser 3.8.1
Using slim 3.0.6
Using coffee-script 2.4.1
Installing sprockets 3.6.0
Using twilio-ruby 4.11.1
Using rails_12factor 0.0.3
Using activesupport 4.2.4
Using loofah 2.0.3
Using mail 2.6.4
Using material_design_lite-sass 1.1.3
Using ruby2ruby 2.3.0
Using html2haml 2.0.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemerchant 1.58.0
Using activemodel 4.2.4
Using rails-html-sanitizer 1.0.3
Using brakeman 3.2.1
Using rails-dom-testing 1.0.7
Using activejob 4.2.4
Using activerecord 4.2.4
Using actionview 4.2.4
Using friendly_id 5.1.0
Using pg_search 1.0.5
Using actionpack 4.2.4
Using actionmailer 4.2.4
Using railties 4.2.4
Using kaminari 0.16.3
Using sprockets-rails 3.0.4
Using coffee-rails 4.1.1
Using responders 2.1.2
Using jquery-rails 4.1.1
Using rails 4.2.4
Using sass-rails 5.0.4
Installing devise 4.0.0
Gem::InstallError: devise requires Ruby version >= 2.1.0.
An error occurred while installing devise (4.0.0), and Bundler cannot continue.
Make sure that `gem install devise -v '4.0.0'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
【问题讨论】:
-
上面写着
devise requires Ruby version >= 2.1.0你试过将 Ruby 升级到 2.1 吗? -
我如何通过 heroku 做到这一点
-
你在本地有同样的问题吗?
-
不,只有当我尝试部署到 heroku 时才会出现问题
-
您可以在 Gemfile 中指定 ruby,或者更好地在您的 heroku 应用配置中设置环境变量:devcenter.heroku.com/articles/ruby-versions
标签: ruby-on-rails heroku devise