Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does rails ignore .bundle by default?

Isn't the point of the project .bundle/config to specify config that is relevant to the project?

like image 424
John Bachir Avatar asked Aug 05 '11 23:08

John Bachir


1 Answers

On the bundle-config manpage is says:

This command allows you to interact with bundler's configuration system. Bundler retrieves its configuration from the local application (app/.bundle/config), environment variables, and the user's home directory (~/.bundle/config), in that order of priority. So ensure that you don't have any configuration files that are taking priority over the one you want to use.

You can configure this file yourself or set options using bundle config (option), running bundle config without any options prints the current configuration. For example you can set compile time options for they mysql gem like so:

bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config

So yes, app/.bundle/config is used to set bundle options for the current project.

Edit: This change was added in commit efa85055 to the Rails github repo. You can view that version of the file here and the commit here.

The commit message is from José Valim and mentions the line you have a question about:

Make bin/rails call rails/commands/application, fix generators usage and update .gitignores.

Edit Again: This is a quote from bundler on why you should not check the .bundle directory into any VCS.

Do not check in the .bundle directory, or any of the files inside it. Those files are specific to each particular machine, and are used to persist installation options between runs of the bundle install command.

like image 94
Devin M Avatar answered Oct 14 '22 04:10

Devin M