开发者

How to install a plugin from github?

I hav开发者_StackOverflow社区e tryed to run this code in my console:

script/plugin install git://github.com/apotonick/cells.git

...but i only get an empty folder named "cells" in my "vendor/plugins" dir. What's wrong?


Check you Git version.
This may be related with you gitconfig file, as described in this thread

The reason is that it appears rails-2.3.5/lib/commands/plugin.rb is trying use git pull to grab the plugin code (see the install_using_git method), which doesn't work right. Example:

script/plugin install git://github.com/fesplugas/typus.git
mkdir vendor/plugins/typus
cd vendor/plugins/typus
git init
git pull --depth 1 git://github.com/fesplugas/typus.git

That last line exits 1, but that error is being masked by the install_using_git method, and the directory is just rm -rf'ed.

I tracked this down to a conflict with ~/.gitconfig. If I remove these lines it works:

 [branch "master"]
   remote = origin
   merge = refs/heads/master

It appears a naked git pull has problems with these settings.

Actually, the problem would be here because of a global git config file (in your homedir: '~/.gitconfig'), defining a master which may be incompatible with the master expected by the git pull within that specific Git repo.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜