繁体   English   中英

从Windows部署到Heroku时出错:说缺少thread_safe,但是在那里

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

当我尝试从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有时会用Gemfile.lock做一些花哨的事情 ,但我没有使用任何Windows特定的gem。

有谁知道发生了什么?

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

我通过在我的Gemfile中指定JRuby作为引擎来“解决”该问题:

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

因此,我仍然不确定发生了什么,只是通用的Heroku Rails 4.x入门指南不足以适用于Windows ...必须依靠这一指南并深入研究自己的示例应用程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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