Derek J
Derek J

Reputation: 807

Rails 3: Bundle Exec

I get the following when trying to start with Mongrel:

You have already activated daemons 1.1.0, but your Gemfile requires daemons 1.0.10. Consider using bundle exec. (Gem::LoadError)

Thanks!

Edit:

My Gemfile:

source 'http://rubygems.org'

gem 'rake', '0.8.7'
gem 'rails', '3.0.0'
gem 'mysql2', '0.2.7'
gem 'tabs_on_rails'
gem 'tabulous'
gem 'devise'
gem 'cancan'
gem 'kaminari'
gem 'formtastic', '~> 1.2.0'
gem 'jquery-rails'
gem 'client_side_validations'
gem 'paperclip'
gem 'paper_trail'
gem 'acts-as-taggable-on'
gem 'acts_as_tree'
gem 'acts_as_list'
gem 'hpricot'
gem 'rails3-jquery-autocomplete'
gem 'meta_where'
gem 'meta_search'
gem 'aws-s3'
gem 'flash_cookie_session'
gem 'mime-types', :require => 'mime/types'
gem 'vanities'
gem 'geokit'
gem 'geokit-rails'
gem 'tiny_mce'
gem 'RedCloth'
gem 'omniauth'
gem 'twitter'
gem 'fb_graph'
gem 'linkedin'
gem 'whenever'
gem 'resque'

group :development, :test do
  gem 'faker'
  gem 'mocha'
  gem 'rails-erd'
  gem 'rspec'
  gem 'rspec-rails'
  gem 'webrat'
  gem 'pickle'
end

Upvotes: 1

Views: 1145

Answers (2)

coreyward
coreyward

Reputation: 80041

bundle exec is the command used to allow Bundler to do it's job and manage gems for different applications (that can be running different versions of the same gems). If you run bundle and then you try to run ruby foo.rb in shell your Gemfile will be ignored and whatever the most up-to-date version of each gem required will be used.

Heroku already uses bundle exec when launching your application. This is built into the platform and it's the only way that makes it possible for them to really handle the slugs like they do.

I think your issue is stemming from an incompatibility between two different gems you have running. If one gem has a dependency on foo ~> 0.2.3 and another gem has a dependency on foo >= 0.3, you aren't going to be able to run them both — you can't have two versions of the same gems available in the same process. You can verify this by running bundle in development and double checking your Gemfile.lock. Also, make sure your Gemfile.lock is being checked-into your repository; if you were to push just your Gemfile that works on your machine to Heroku and they install based on it, they might wind up with newer versions of libraries with different dependencies (I'm not sure if Heroku will complain if you don't have the Gemfile.lock).

Upvotes: 2

Sam 山
Sam 山

Reputation: 42865

Any gems that you are using for a different server in development you need to put under a development name space or take them out.

For example. I only want this gem for development. Do this for those gems:

group :development do
    gem 'capistrano', '2.6.0', :require => nil
end

Upvotes: 0

Related Questions