Trying to figure out how to install rails plugins manually on windows so I have a few questions.
-
What does the directory need to be named in vendor/plugins? Is it arbitrary or is it linked to something within the plugin config files or is that what you set in the environment.rb?
-
Once I’ve copied the files to the correct directory, do I always need to run something inside like init.rb or is it good to go?
-
What’s the difference between ‘require’ and ‘include’?
Thanks!
Depends on your definition of “need”. In theory the plugin directories could be called
plugin1,plugin2,plugin3etc. But for the sake of your own sanity, it is better that they are named after the plugin they host, so thewill_paginateplugin should be inside thevendor/plugins/will_paginatedirectory and so on.If they are hosted on github, the folders will be called the same way as the github project.
Normally all plugins will have a
init.rbfile on their “root folder” :vendor/plugins/will_paginate/init.rb. That’s how you can know that you put the right files on the right path. They also usually (not allways) have alibdirectory inside them:vendor/plugins/will_paginate/lib/*You don’t need to run
init.rbyourself, but it neither exactly “good to go”: You have to re-start the web server. When initializing, rails goes through thevendor/plugins/*directories, calling theinit.rbfiles itself.That’s a completely different question. Besides, it is already answered on StackOverflow. So I hope you don’t mind if I point you to the already existing question & its answers.
The simplest way is actually installing git on windows. This can be done with msysgit.
Then your
script/plugin installwill probably work. If it doesn’t you can install the plugin yourself usinggit clone. Here’s an example with a random github plugin:This will create the plugin folder just like
script/plugin installwould. Just don’t forget to cd to thevendor/pluginsfolder first.If you can’t/don’t want to use git, then github has a ‘download as a zip’ link on the top of each project. I guess you can download the plugins as zips and them uncompress them on the right places.
I hope this helps.