当前位置: 动力学知识库 > 问答 > 编程问答 >

ruby on rails - How to install a plugin from github?

问题描述:

I have 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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: