简体   繁体   English

Heroku上的“ bundler:无法加载命令:thin”

[英]“bundler: failed to load command: thin” on Heroku

I'm using Ruby 2.2.7, and Rails 3.2.21, and trying to deploy an with gem: locomotive_cms of version: ~> 2.5.7 on Heroku, and it gets deployed successfully, but I'm facing the following error: 我正在使用Ruby 2.2.7和Rails 3.2.21,并尝试在Heroku上部署一个gem: locomotive_cms版本: ~> 2.5.7 ,并且成功部署了它,但是我遇到了以下错误:

2017-08-12T23:33:13.732440+00:00 app[web.1]: bundler: failed to load command: thin (/app/vendor/bundle/ruby/2.2.0/bin/thin) 2017-08-12T23:33:13.732490+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/excon-0.23.0/lib/excon/middlewares/expects.rb:6:in `response_call' 2017-08-12T23:33:13.732440 + 00:00 app [web.1]:捆绑程序:无法加载命令:瘦(/app/vendor/bundle/ruby/2.2.0/bin/thin)2017-08- 12T23:33:13.732490 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.2.0/gems/excon-0.23.0/lib/excon/middlewares/expects.rb:6:in `response_call'

And with that, it produces this too: 这样,它也产生了:

Heroku::API::Errors::ErrorWithResponse: Expected(200) <=> Actual(400 Bad Request) Heroku :: API :: Errors :: ErrorWithResponse:预期(200)<=>实际(400错误的请求)

I have thin in my Gemfile which is necessary for locomotivecms according to its documentation. 我的Gemfile thin ,根据其文档对机车来说是必需的。

I have been on other similar questions too, but I'm still unable to solve my problem. 我也曾在其他类似的问题上,但我仍然无法解决我的问题。 I have Ruby version: 2.2.7 , and while it is saying: /app/vendor/bundle/ruby/2.2.0/bin/thin 我有Ruby版本: 2.2.7 ,虽然它说: /app/vendor/bundle/ruby/2.2.0/bin/thin

Gemfile: 的Gemfile:

source 'https://rubygems.org'
ruby "2.2.7"

gem 'rails', '3.2.21'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'locomotive_cms', '~> 2.5.7', :require => 'locomotive/engine'
gem 'dotenv-rails'

gem 'savon', '~> 2.3.0' # SOAP client for pulling in events
gem 'twitter', '5.8.0'
gem 'twitter-text'
gem 'whenever', require: false


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'compass-rails',  '~> 2.0.0'
  gem 'sass-rails',   '~> 3.2.4'
  gem 'coffee-rails', '~> 3.2.2'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '~> 1.2.4'
end

group :development do
  gem 'unicorn'
  gem 'pry'
end


# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

# To use on Heorku
gem 'locomotive-heroku', '~> 0.1.0', :require => 'locomotive/heroku'
gem 'thin'

Gemfile.lock: Gemfile.lock的:

You can find it here: https://gist.github.com/Arslan-Ali-Butt/640c1ec1750d17c9803e12a492f35c4e 您可以在这里找到它: https : //gist.github.com/Arslan-Ali-Butt/640c1ec1750d17c9803e12a492f35c4e

Sorry in advance for the bad news. 不好意思,对不起。

I've taking a look at your Gemfile and Gemfile.lock, and also at the PR https://github.com/locomotivecms/locomotive-heroku/pull/11 and the latest 2.5.x branch of locomotive_cms at https://github.com/locomotivecms/engine/tree/v2.5.x . 我正在查看您的Gemfile和Gemfile.lock,以及PR的https://github.com/locomotivecms/locomotive-heroku/pull/11和locomotive_cms的最新2.5.x分支, 网址https:// github.com/locomotivecms/engine/tree/v2.5.x You've reached the end of functionality due to the lack of maintenance on the versions of the Gems that you depend on. 由于缺少所依赖的Gems版本的维护,因此您已经达到功能性的尽头。

locomotive_cms has been renamed to locomotivecms and bumped to version 3+. locomotive_cms已重命名为locomotivecms并且版本升至3+。 The locomotive_cms gem is no longer maintained. locomotive_cms宝石不再维护。 Not only that, but it's no longer compatible with a bunch of the other dependencies you're using, namely excon. 不仅如此,它也与您正在使用的其他一系列依赖项(即Excon)不再兼容。

Bundler could not find compatible versions for gem "excon":
  In Gemfile:
    locomotive_cms was resolved to 2.5.8, which depends on
      fog (~> 1.12.1) was resolved to 1.12.1, which depends on
        excon (~> 0.23.0)

    locomotive-heroku was resolved to 0.1.0, which depends on
      heroku-api (~> 0.3.23) was resolved to 0.3.23, which depends on
        excon (~> 0.44)

You're going to want to go through the upgrade guide at https://locomotive-v3.readme.io/docs/upgrade-to-v3 . 您将要通过https://locomotive-v3.readme.io/docs/upgrade-to-v3上的升级指南进行操作。

Add a Procfile (place a file named Procfile in the root of your app), to tell Heroku to use thin, like so: 添加一个Procfile (在应用程序的根目录中放置一个名为Procfile的文件),以告诉Heroku使用Thin,如下所示:

web: bundle exec thin start -p $PORT

That will allow you to run thin in production on Heroku. 这将使您在Heroku上进行精简生产。 I assume that your Gemfile is properly configured 我认为您的Gemfile已正确配置

The second message points to a bad request according to Heroku API guide , but it's hard to tell how it is connected to the first error message. 根据Heroku API指南 ,第二条消息指向错误的请求,但是很难告诉它如何连接到第一条错误消息。

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

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