script/plugin install with github

Hello,

since switching from svn to git, I'm having trouble using script/ plugin install with github plugins.

here's what happens:

script/plugin install git://github.com/thoughtbot/paperclip.git Initialized empty Git repository in /path/to/project/vendor/plugins/paperclip/.git/ fatal: bad revision 'HEAD' refusing to pull with rebase: your working tree is not up-to-date

git works fine in general, and I can push and pull from my gihub repo. is this a path issue?

any suggestions would be appreciated!

What version of ruby are you using?

ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-darwin8.10.1]

I've been using git clone to pull down plugins, but doesn't script/ plugin also run internal init scripts etc. that are sometimes included in the plugin itself?

joelmahoney wrote:

I've been using git clone to pull down plugins, but doesn't script/ plugin also run internal init scripts etc. that are sometimes included in the plugin itself?

Yes.

Best,

Based on what I'm seeing when I run here:

/test1.8 92 > script/plugin install git://github.com/thoughtbot/paperclip.git Initialized empty Git repository in /Users/rick/test1.8/vendor/plugins/ paperclip/.git/ remote: Counting objects: 67, done. remote: Compressing objects: 100% (56/56), done. remote: Total 67 (delta 6), reused 31 (delta 3) Unpacking objects: 100% (67/67), done. From git://github.com/thoughtbot/paperclip * branch HEAD -> FETCH_HEAD /test1.8 93 >

My guess is your problem is with git, not rails. Is is possible that you've got a git repository local for paperclip?

here's what happens:

> script/plugin install git://github.com/thoughtbot/paperclip.git > Initialized empty Git repository in /path/to/project/vendor/plugins/paperclip/.git/ > fatal: bad revision 'HEAD' > refusing to pull with rebase: your working tree is not up-to-date

Check the git documentation for "rebase"

Rick

thanks Rick - I will dig deeper in the git documentation - maybe reinstall git altogether (though I installed with macports, so I don't know what the problem would be...)

one question: when you say I might have a git repository local for paperclip, what do you mean exactly?

Joel

Based on what I'm seeing here:

/test1.8 92 > script/plugin install git://github.com/thoughtbot/paperclip.git Initialized empty Git repository in /Users/rick/test1.8/vendor/plugins/ paperclip/.git/ remote: Counting objects: 67, done. remote: Compressing objects: 100% (56/56), done. remote: Total 67 (delta 6), reused 31 (delta 3) Unpacking objects: 100% (67/67), done. From git://github.com/thoughtbot/paperclip * branch HEAD -> FETCH_HEAD /test1.8 93 >

My guess is that your problem is on the git side of things, not rails. Since your error message comes from

one question: when you say I might have a git repository local for paperclip, what do you mean exactly?

Have you used git to do configuration management on your own code? Have you used git to clone a copy of the paperclip plugin? Do you have a local ~/.git directory or a ~/.gitconfig file?

My supposition was that you have some local (test or learn) work that is somehow interfering with your script/plugin install call. You shouldn't need to "port uninstall git ; port install git" to get things working.

Just to give you a frame of reference I'm working on Mac OS X 10.5.7, PPC G4. ruby --version == ruby 1.8.7 (2009-06-08 patchlevel 173) [powerpc- darwin9.7.0] rails --version == 2.3.3 git --version == git version 1.6.1.2

To get some additional information you can use the command: script/plugin --verbose install git://github.com/thoughtbot/paperclip.git

You can also view the rails source in:    lib/ruby/gems/1.8/gems/rails-2.3.3/lib/commands/plugins.rb Look for:    def install_using_git(options = {})

In this function the line "install_path = mkdir_p ..." has trouble when run in ruby 1.9 - thus my initial question.