Question

I wrote an application in RoR, then i tried to deploy it on appfog. I created application, but after pushing i got this error:

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

My Gemfile:

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

And my production config:

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

Is it all about bundler version on server?

Can you guys help me? I am new at Ror. Localy everything works fine. I tried to add 'bundler' as a gem with older version to gemfile, but it didn't help.

----- EDIT -----

logs after pushing application with --runtime ruby193:

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
Était-ce utile?

La solution

The problem is that Appfog is trying to run your app in ruby 1.8 because it is the default as you can see on https://docs.appfog.com/languages/ruby

As the documentation tells, you need to provide the parameter --runtime ruby193 for ruby 1.9.3

So when you push your app you need to do it like

af push <appname> --runtime ruby193

Update

Bad news, appfog still does not support rails 4. As you can see on this post others have the same problem.

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

Appfog has bundler version 1.1.3 and rails4 requires 1.3.0

Solution for you: Downgrade to rails 3.2 or choose a different provider :/ it's sad but this is life.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top