Since Ruby 1.8.7 and Rails 2.3.5 under MS Windows system there is a common error when you run:
%rails_project_directory> ruby script/plugin install git://github.com/user/project.git
The problem is that no matter what variations and workarounds through comman line would you try:
%rails_project_directory>ruby script\plugin install http://github.com/user/project.git/
you always get the error:
Plugin not found: [git://github.com/user/project.git]
Certainly you could just download a from GIT project and copy/clone it to the vendor/plugins directory of your project. However you must admit it is a pain. Each time I installed manually a git-hosted plugin (so almost in 95% of Rails plugins :-P), I spent about half an hour looking for a solutions. And this morning I’ve eventually found it on www.ruby-forum.com.
Soultion
The soultion is as follows:
- Install msysgit if you haven’t done it yet.
- Go to %ruby_installation_directory\lib\ruby\gems\1.8\gems\activesupport-2.3.5\lib\active_support\core_ext\kernel and open reporting.rb in a text editor.
(%ruby_installation_directory is c:\Rails by default) - Around line 38 find:
stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null')
and change it to:
#stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') stream.reopen('NUL:')
- Save the file and live in a joy and happiness of working git hosted Rails plugin installation
maj 1st, 2010
Tags: Ruby on Rails, tips&tricks