Gemfile: Make sure some gems are available on the machine, but don't need to be loaded for the project

StackOverflow https://stackoverflow.com//questions/11665313

  •  11-12-2019
  •  | 
  •  

I didn't work with RoR for 2-3 years, but now I'm back in business, and I really like the bundle command. But I'm a bit unsure how to make sure my fellow developers have all gems installed that are not strictly part of the Rails application.

For example, we use YARD for documentation. YARD doesn't have anything to do with the Rails project we are working on, so I'm not sure whether I should add it to its Gemfile. On the other hand, this is the only way to make sure every developer has it installed automatically.

And if I add it to Gemfile, how exactly should I do it? In the :development group, so it doesn't get loaded for production? But strictly speaking, it also shouldn't be loaded in development, it simply just be installed so it can be used manually.

So how should I add it? Thanks, guys, for help.

有帮助吗?

解决方案

Gemfile中的:development组是正确的正确位置。有很好的命令,意思是用户只能安装他们需要的特定组。查看文档有关使用Bundler 的组的更多信息。

您可以查看Rails项目的Gemfile本身请注意,它们有一个名为:doc的组,它们用于相同的效果。

其他提示

如果您感觉到:App Gemfile中的开发范围不是正确的地方,您可以参加仅为此目的而存在的共享宝石。(即,在包含此Gemfile的某个位置设置存储库,运行捆绑安装在其上,Gems将在本地安装)。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top