开发者

Why does rails ignore .bundle by default?

Isn't the point of the project .bundle/config to specify c开发者_高级运维onfig that is relevant to the project?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜