从Windows部署到Heroku时出错:说thread_safe丢失了,但它就在那里

时间:2016-03-10 18:26:53

标签: ruby windows heroku

当我尝试从Windows部署到Heroku时,我收到此错误:

  

依赖项部分中缺少以下gem:thread_safe

这是Heroku日志:


    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'

这是我的Gemfile.lock,它在依赖关系部分明确包含thread_safe

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

我知道Heroku有时does fancy things with the Gemfile.lock,但我没有使用任何特定于Windows的宝石。

任何人都知道发生了什么?

2 个答案:

答案 0 :(得分:0)

将此行添加到/config/application.rb     config.threadsafe! 并运行     bundle update

答案 1 :(得分:0)

我&#34;修复&#34;通过在我的Gemfile中指定JRuby作为引擎来解决问题:

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

所以我仍然不确定发生了什么,只是the generic Heroku Rails 4.x start guide对Windows来说还不够......必须依靠this one并深入了解他们的示例应用你自己的。