首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >appfog上rails应用程序中的Gemfile依赖问题

appfog上rails应用程序中的Gemfile依赖问题
EN

Stack Overflow用户
提问于 2014-02-01 15:53:44
回答 1查看 193关注 0票数 0

我用RoR编写了一个应用程序,然后尝试在appfog上部署它。我创建了应用程序,但在按下之后,我得到了以下错误:

代码语言:javascript
复制
Uploading Application:
  Checking for available resources: OK
  Processing resources: OK
  Packing application: OK
  Uploading (2M): OK
Push Status: OK
Stopping Application 'otj': OK

Staging Application 'otj': OK
Starting Application 'otj': ..
Error: Application [otj] failed to start, logs information below.
====> /logs/migration.log <====

/var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app/rubygems/rub
y/1.8/gems/bundler-1.1.3/lib/bundler/resolver.rb:129:in `resolve': Bundler could
 not find compatible versions for gem "bundler": (Bundler::VersionConflict)
  In Gemfile:
    rails (= 4.0.0) ruby depends on
      bundler (< 2.0, >= 1.3.0) ruby

  Current Bundler version:
    bundler (1.1.3)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/resolver.rb:127:in `catch'
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/resolver.rb:127:in `resolve'
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/definition.rb:192:in `resolve'

        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/definition.rb:127:in `specs'
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/definition.rb:172:in `specs_fo
r'
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/definition.rb:161:in `requeste
d_specs'
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/environment.rb:23:in `requeste
d_specs'
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:11:in `setup'
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler.rb:107:in `setup'
        from /var/vcap.local/dea/apps/otj-0-93de4f274c73b17a027e6b04e23a0723/app
/rubygems/ruby/1.8/gems/bundler-1.1.3/lib/bundler/setup.rb:17

====> /logs/staging.log <====

# Logfile created on 2014-02-01 15:33:19 +0000 by logger.rb/25413
Adding coffee-script-source-1.7.0.gem to app...
Adding execjs-2.0.2.gem to app...
Adding coffee-script-2.2.0.gem to app...

[Adding other gems]

Adding json-1.8.1.gem to app...
Adding uglifier-2.4.0.gem to app...
Adding bundler-1.1.3.gem to app...
Adding cf-autoconfig-0.0.4.gem to app...
Adding cf-runtime-0.0.2.gem to app...
Running rake assets:precompile
Assets precompilation failed: /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/rub
y/gems/1.8/gems/bundler-1.1.3/lib/bundler/resolver.rb:129:in `resolve': Bundler
could not find compatible versions for gem "bundler": (Bundler::VersionConflict)

  In Gemfile:
    rails (= 4.0.0) ruby depends on
      bundler (< 2.0, >= 1.3.0) ruby

  Current Bundler version:
    bundler (1.1.3)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/resolver.rb:127:in `catch'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/resolver.rb:127:in `resolve'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/definition.rb:192:in `resolve'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/definition.rb:127:in `specs'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/definition.rb:172:in `specs_for'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/definition.rb:161:in `requested_specs'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/environment.rb:23:in `requested_specs'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/runtime.rb:11:in `setup'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler.rb:107:in `setup'
        from /opt/cloudfoundry/runtimes/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/b
undler-1.1.3/lib/bundler/setup.rb:17

Turning on live assets compilation

我的个人档案:

代码语言:javascript
复制
source 'https://rubygems.org'
source 'https://rails-assets.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

gem 'pg'

gem 'sass-rails', '>= 4.0.0'

gem 'uglifier', '>= 1.3.0'

gem 'coffee-rails', '>= 4.0.0'

gem 'jquery-rails'

gem 'turbolinks'

gem 'jbuilder', '>= 1.2'

gem "rails-assets", ">= 0.5.2"
gem 'rails-assets-bootstrap'
gem 'cancan'
gem 'activeadmin', :github => 'gregbell/active_admin'


group :production do
  gem 'mysql'
end

我的产品配置:

代码语言:javascript
复制
OTD::Application.configure do

  config.cache_classes = true

  config.eager_load = true

  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  config.serve_static_assets = true

  config.assets.js_compressor = :uglifier

  config.assets.compile = false

  config.assets.digest = true

  config.assets.version = '1.0'

  config.log_level = :info

  config.i18n.fallbacks = true

  config.active_support.deprecation = :notify

  config.log_formatter = ::Logger::Formatter.new
end

是关于服务器上的邦德勒版本吗?

你们能帮帮我吗?我是罗尔的新手。一切都很好。我试图将“bundler”作为一个具有更老版本的宝石添加到gem文件中,但这并没有帮助。

-编辑-编辑

使用--运行时ruby193推送应用程序后的日志:

代码语言:javascript
复制
Starting Application 'otj': ..
Error: Application [otj] failed to start, logs information below.
====> /logs/migration.log <====

/var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app/rubygems/rub
y/1.9.1/gems/bundler-1.1.3/lib/bundler/resolver.rb:129:in `block in resolve': Bu
ndler could not find compatible versions for gem "bundler": (Bundler::VersionCon
flict)
  In Gemfile:
    rails (= 4.0.0) ruby depends on
      bundler (< 2.0, >= 1.3.0) ruby

  Current Bundler version:
    bundler (1.1.3)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/resolver.rb:127:in `catch'
        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/resolver.rb:127:in `resolve'

        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:192:in `resolv
e'
        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:127:in `specs'

        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:172:in `specs_
for'
        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:161:in `reques
ted_specs'
        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/environment.rb:23:in `reques
ted_specs'
        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/runtime.rb:11:in `setup'
        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler.rb:107:in `setup'
        from /var/vcap.local/dea/apps/otj-0-8ce72d0af7bc6b832f55fbaf5d913528/app
/rubygems/ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/setup.rb:17:in `<top (requir
ed)>'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1
/rubygems/custom_require.rb:36:in `require'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1
/rubygems/custom_require.rb:36:in `require'

====> /logs/staging.log <====

# Logfile created on 2014-02-01 18:00:53 +0000 by logger.rb/25413
Adding coffee-script-source-1.7.0.gem to app...
Adding execjs-2.0.2.gem to app...
Adding coffee-script-2.2.0.gem to app...

[oher gems]

Adding json-1.8.1.gem to app...
Adding uglifier-2.4.0.gem to app...
Adding bundler-1.1.3.gem to app...
Adding cf-autoconfig-0.0.4.gem to app...
Adding cf-runtime-0.0.2.gem to app...
Running rake assets:precompile
Assets precompilation failed: /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/rub
y/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/resolver.rb:129:in `block in resolve
': Bundler could not find compatible versions for gem "bundler": (Bundler::Versi
onConflict)
  In Gemfile:
    rails (= 4.0.0) ruby depends on
      bundler (< 2.0, >= 1.3.0) ruby

  Current Bundler version:
    bundler (1.1.3)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/resolver.rb:127:in `catch'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/resolver.rb:127:in `resolve'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/definition.rb:192:in `resolve'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/definition.rb:127:in `specs'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/definition.rb:172:in `specs_for'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/definition.rb:161:in `requested_specs'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/environment.rb:23:in `requested_specs'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/runtime.rb:11:in `setup'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler.rb:107:in `setup'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems
/bundler-1.1.3/lib/bundler/setup.rb:17:in `<top (required)>'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1
/rubygems/custom_require.rb:36:in `require'
        from /opt/cloudfoundry/runtimes/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1
/rubygems/custom_require.rb:36:in `require'

Turning on live assets compilation
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-02-01 17:02:58

问题是Appfog试图在ruby1.8中运行您的应用程序,因为它是默认的,正如您在https://docs.appfog.com/languages/ruby上看到的那样

如文档所示,您需要为ruby1.9.3提供参数--runtime ruby193

所以当你按下你的应用程序时,你需要像

代码语言:javascript
复制
af push <appname> --runtime ruby193

更新

坏消息是,appfog仍然不支持rails 4。正如您在这篇文章中看到的,其他人也有同样的问题。

http://feedback.appfog.com/forums/171983-appfog/suggestions/3954090-please-update-bundler

Appfog有更好的版本1.1.3,rails4需要1.3.0

你的解决方案:降级到rails 3.2或者选择不同的提供者:/这是可悲的,但这是生活。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21500201

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档