Rails or rail sets

In rails 3, rails s makes a call to bundler, so you donโ€™t have to do bundle exec rails s or bundle exec , which is necessary to run rails s in your application gemfile environment?

Update He realized that bundle exec should be used before rake tasks due to different versions of rake. See http://railsapps.github.com/installing-rails-3-1.html for more details. This question is about rails scripts such as:

 rails s rails server rails c rails console 

^ Should bundle exec be used before these rail scripts or is the rails command communicating with the switch?

+6
source share
2 answers

You should get this behavior in Rail> = 3.1, but you need to be careful because you can use an earlier version of rake:

Itโ€™s good practice to use the exec rake command line instead of rake so you are using the version of Rake specified in your gemfile (or the dependencies specified in the Gemfile.lock file) and not the default version. For example, instead of rake db: migrate, run the exec rake db: package. migrates

What you need to know: make sure you are using Rake 0.9.2.2 (or newer) with a rake update gradient before installing Rails 3.1. And use the bundle exec rake command instead of the rake.

Quote from: http://railsapps.github.com/installing-rails-3-1.html

This seems to be true for the rails command:

Do not run the exec command before the rails command, rails already checks for the presence of the Bundler via the Gemfile and configures everything according to it without the overhead of batch exec. rails is the only exception to the rule.

Quote from: http://blog.wyeworks.com/2011/12/27/bundle-exec-rails-executes-bundler-setup-3-times

+9
source

http://bundler.io/v1.5/rails3.html - "Rails 3 comes with support baked with a package ... Bundler transparently manages your dependencies!" So just start the server with

 rails server 
0
source

Source: https://habr.com/ru/post/921144/


All Articles