简体   繁体   中英

Error deploying to Heroku from Windows: says thread_safe is missing but it's there

When I try to deploy to Heroku from Windows, I get this error:

the following gem is missing from the dependencies section: thread_safe

Here's the Heroku log:

Counting objects: 75, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (66/66), done.
    Writing objects: 100% (75/75), 17.25 KiB | 0 bytes/s, done.
    Total 75 (delta 4), reused 0 (delta 0)
    remote: Compressing source files... done.
    remote: Building source:
    remote:
    remote: -----> Ruby app detected
    remote: -----> Compiling Ruby/Rails
    remote: -----> Using Ruby version: ruby-2.2.2
    remote: -----> Installing dependencies using bundler 1.11.2
    remote:        Running: bundle install --without development:test --path vendor/
    bundle --binstubs vendor/bundle/bin -j4 --deployment
    remote:        Fetching gem metadata from https://rubygems.org/...........
    remote:        Fetching version metadata from https://rubygems.org/...
    remote:        Fetching dependency metadata from https://rubygems.org/..
    remote:        Installing rake 11.0.1
    remote:        Installing minitest 5.8.4
    remote:        Installing i18n 0.7.0
    remote:        Your Gemfile.lock is corrupt. The following gem is missing from t
    he DEPENDENCIES
    remote:        section: 'thread_safe'
    remote:        Bundler Output: Fetching gem metadata from https://rubygems.org/.
    ..........
    remote:        Fetching version metadata from https://rubygems.org/...
    remote:        Fetching dependency metadata from https://rubygems.org/..
    remote:        Installing rake 11.0.1
    remote:        Installing minitest 5.8.4
    remote:        Installing i18n 0.7.0
    remote:        Your Gemfile.lock is corrupt. The following gem is missing from t
    he DEPENDENCIES
    remote:        section: 'thread_safe'
    remote:  !
    remote:  !     Failed to install gems via Bundler.
    remote:  !
    remote:
    remote:  !     Push rejected, failed to compile Ruby app
    remote:
    remote: Verifying deploy...
    remote:
    remote: !       Push rejected to mighty-thicket-40758.
    remote:
    To https://git.heroku.com/mighty-thicket-40758.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/mighty-thicket-40758.
    git'

Here's my Gemfile.lock , which clearly contains thread_safe in the dependencies section:

GEM
remote: https://rubygems.org/
specs:
    actionmailer (4.1.8)
    actionpack (= 4.1.8)
    actionview (= 4.1.8)
    mail (~> 2.5, >= 2.5.4)
    actionpack (4.1.8)
    actionview (= 4.1.8)
    activesupport (= 4.1.8)
    rack (~> 1.5.2)
    rack-test (~> 0.6.2)
    actionview (4.1.8)
    activesupport (= 4.1.8)
    builder (~> 3.1)
    erubis (~> 2.7.0)
    activemodel (4.1.8)
    activesupport (= 4.1.8)
    builder (~> 3.1)
    activerecord (4.1.8)
    activemodel (= 4.1.8)
    activesupport (= 4.1.8)
    arel (~> 5.0.0)
    activerecord-jdbc-adapter (1.3.20)
    activerecord (>= 2.2)
    activerecord-jdbcpostgresql-adapter (1.3.20)
    activerecord-jdbc-adapter (~> 1.3.20)
    jdbc-postgres (>= 9.1)
    activesupport (4.1.8)
    i18n (~> 0.6, >= 0.6.9)
    json (~> 1.7, >= 1.7.7)
    minitest (~> 5.1)
    thread_safe (~> 0.1)
    tzinfo (~> 1.1)
    arel (5.0.1.20140414130214)
    builder (3.2.2)
    coffee-rails (4.0.1)
    coffee-script (>= 2.2.0)
    railties (>= 4.0.0, < 5.0)
    coffee-script (2.4.1)
    coffee-script-source
    execjs
    coffee-script-source (1.10.0)
    erubis (2.7.0)
    execjs (2.6.0)
    hike (1.2.3)
    i18n (0.7.0)
    jbuilder (2.4.1)
    activesupport (>= 3.0.0, < 5.1)
    multi_json (~> 1.2)
    jdbc-postgres (9.4.1206)
    jquery-rails (3.1.4)
    railties (>= 3.0, < 5.0)
    thor (>= 0.14, < 2.0)
    json (1.8.3-java)
    mail (2.6.3)
    mime-types (>= 1.16, < 3)
    mime-types (2.99.1)
    minitest (5.8.4)
    multi_json (1.11.2)
    rack (1.5.5)
    rack-test (0.6.3)
    rack (>= 1.0)
    rails (4.1.8)
    actionmailer (= 4.1.8)
    actionpack (= 4.1.8)
    actionview (= 4.1.8)
    activemodel (= 4.1.8)
    activerecord (= 4.1.8)
    activesupport (= 4.1.8)
    bundler (>= 1.3.0, < 2.0)
    railties (= 4.1.8)
    sprockets-rails (~> 2.0)
    rails_12factor (0.0.3)
    rails_serve_static_assets
    rails_stdout_logging
    rails_serve_static_assets (0.0.5)
    rails_stdout_logging (0.0.4)
    railties (4.1.8)
    actionpack (= 4.1.8)
    activesupport (= 4.1.8)
    rake (>= 0.8.7)
    thor (>= 0.18.1, < 2.0)
    rake (11.0.1)
    rdoc (4.2.2)
    json (~> 1.4)
    sass (3.2.19)
    sass-rails (4.0.5)
    railties (>= 4.0.0, < 5.0)
    sass (~> 3.2.2)
    sprockets (~> 2.8, < 3.0)
    sprockets-rails (~> 2.0)
    sdoc (0.4.1)
    json (~> 1.7, >= 1.7.7)
    rdoc (~> 4.0)
    sprockets (2.12.4)
    hike (~> 1.2)
    multi_json (~> 1.0)
    rack (~> 1.0)
    tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.3.3)
    actionpack (>= 3.0)
    activesupport (>= 3.0)
    sprockets (>= 2.8, < 4.0)
    therubyrhino (2.0.4)
    therubyrhino_jar (>= 1.7.3)
    therubyrhino_jar (1.7.6)
    thor (0.19.1)
    thread_safe (0.3.5-java)
    tilt (1.4.1)
    turbolinks (2.5.3)
    coffee-rails
    tzinfo (1.2.2)
    thread_safe (~> 0.1)
    tzinfo-data (1.2016.1)
    tzinfo (>= 1.0.0)
    uglifier (2.7.2)
    execjs (>= 0.3.0)
    json (>= 1.8.0)

PLATFORMS
java

DEPENDENCIES
activerecord-jdbcpostgresql-adapter
coffee-rails (~> 4.0.0)
jbuilder (~> 2.0)
jquery-rails
rails (= 4.1.8)
rails_12factor
sass-rails (~> 4.0.3)
sdoc (~> 0.4.0)
therubyrhino
thread_safe
turbolinks
tzinfo-data
uglifier (>= 1.3.0)

BUNDLED WITH
1.11.2

I know Heroku sometimes does fancy things with the Gemfile.lock , but I'm not using any Windows-specific gems.

Anyone know what's going on?

Add this line to /config/application.rb config.threadsafe! And run bundle update

I "fixed" the problem by specifying JRuby as the engine in my Gemfile:

ruby '2.2.2', :engine => 'jruby', :engine_version => '9.0.0.0'

So I'm still not sure what was happening, just that the generic Heroku Rails 4.x start guide isn't sufficient for Windows...must rely on this one and dig into their sample app to make your own.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM