更新
据了解,由于rake版本不同,应该在rake任务之前使用bundle exec.有关详细信息,请参见http://railsapps.github.com/installing-rails-3-1.html.这个问题是关于rails脚本的,比如:
rails s rails server rails c rails console
^应该在这些rails脚本之前使用bundle exec,还是rails命令调用bundle?
解决方法
It’s good practice to use the command bundle exec rake instead of rake
so you’ll use the version of Rake specified in your gemfile (or a
dependency specified in the Gemfile.lock file) instead of the default
version. For example,instead of rake db:migrate,run bundle exec rake
db:migrate.What You Need to Know: Make sure you are using Rake 0.9.2.2 (or newer)
with gem update rake before installing Rails 3.1. And use bundle exec
rake instead of rake.
引用自:http://railsapps.github.com/installing-rails-3-1.html
看起来与rails命令相反:
don’t run bundle exec before rails command,rails already checks the
presence of Bundler through the Gemfile and sets up everything
according to it without the overhead of bundle exec. rails command is
the only exception to the rule.
引自:http://blog.wyeworks.com/2011/12/27/bundle-exec-rails-executes-bundler-setup-3-times