开发者

In Rails, if "gem install ___" installs 6 gems total, will installing as plugin require installing the other 5 gems manually?

If installing a gem using

gem install ______

actually install 6 gems, because of the dependencies, then if the gem is installed as plugin by

script/plugin install git://github.com/author/____.git

or

script/plugin开发者_高级运维 install _____

then we to manually install the gem it depends on?

Does it matter if it is the later form, where it doesn't get it from github?


If you're worried about gems and dependencies, plugins are probably not the way to go. I would recommend checking out Bundler. It allows you to lock your gem versions and makes it really easy to manage gem sets across multiple servers, and developers.


Plugins are supposed to include their own dependencies inside them so you'll have:

# my_rails_project/vendor/plugins/thatfancyplugin/vendor/<their dependencies>

If the plugin you're looking at includes those other gems inside the repo, you'll be fine to just install the plugin. I expect it doesn't though which would require you to explicitly define the requirements in your config/environment.rb file.

It's for this reason that I'd recommend using it as a gem, because then you don't have to manually specify requirements that shouldn't be concerning you. A number of plugins have changed their recommended installation instructions telling people to install as a gem instead of a plugin, which is I expect mostly for this reason.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜