Sunday, August 30, 2009

Rails Basics : How to Install a Plugin from the Command Line ?

Although Aptana Radrails and other Rails IDE usually have a Rails Plugin Tab or its equivalent, I personally feel that it easier and more flexible to do so using the Command Line.

To do so in Ubuntu 9.04, click Applications/Accessories/Terminal to open a terminal window and cd to the root of your Rails Project as follows :-

chee@ibm4linux:~$ cd workspace
chee@ibm4linux:~/workspace$ cd crm2009

chee@ibm4linux:~/workspace/crm2009$ script/plugin install

To discover the various options available in script/plugin

chee@ibm4linux:~/workspace/crm2009$ script/plugin --
Unknown command:
Usage: plugin [OPTIONS] command
Rails plugin manager.
GENERAL OPTIONS
  -r, --root=DIR                   Set an explicit rails app directory.
                                   Default: /home/chee/workspace/crm2009
  -s, --source=URL1,URL2           Use the specified plugin repositories instead of the defaults.
  -v, --verbose                    Turn on verbose output.
  -h, --help                       Show this help message.
COMMANDS
  discover   Discover plugin repositories.
  list       List available plugins.
  install    Install plugin(s) from known repositories or URLs.
  update     Update installed plugins.
  remove     Uninstall plugins.
  source     Add a plugin source repository.
  unsource   Remove a plugin repository.
  sources    List currently configured plugin repositories.

EXAMPLES
  Install a plugin:
    plugin install continuous_builder

  Install a plugin from a subversion URL:
    plugin install http://dev.rubyonrails.com/svn/rails/plugins/continuous_builder

  Install a plugin from a git URL:
    plugin install git://github.com/SomeGuy/my_awesome_plugin.git

  Install a plugin and add a svn:externals entry to vendor/plugins
    plugin install -x continuous_builder

  List all available plugins:
    plugin list

  List plugins in the specified repository:
    plugin list --source=http://dev.rubyonrails.com/svn/rails/plugins/

  Discover and prompt to add new repositories:
    plugin discover

  Discover new repositories but just list them, don't add anything:
    plugin discover -l

  Add a new repository to the source list:
    plugin source http://dev.rubyonrails.com/svn/rails/plugins/

  Remove a repository from the source list:
    plugin unsource http://dev.rubyonrails.com/svn/rails/plugins/

  Show currently configured repositories:
    plugin sources

No comments:

Welcome to Rails.. Rails... Rails !

In 1995, I started the popular Clipper...Clipper... Clipper website (no blogs then) which was very popular and linked by virtually every Clipper-related site. When I switched to Windows via Delphi in 1997, I started the Delphi... Delphi... Delphi site. In June 2007, I discovered Ruby on Rails and no prize for guessing what I am gonna name this blog. which I started on 2nd October 2007.

As at 10th June 2010, we have 13,364 unique visitors from more than 84 countries such as Angola, Andorra, Argentina, Australia, Austria, Algeria,Barbados, Bosnia and Herzogovina, Belgium, Brazil, Bulgaria, Bangladesh, Belarus, Bolivia, Chile, Cambodia, Cape Vede, Canada, China, Colombia, Costa Rica, Croatia, Cyprus, Czech Republic, Denmark, Egypt, Estonia, Finland, France, Guadeloupe, Guatemala, Germany, Greece, Hong Kong, Hungary, India, Indonesia, Ireland, Israel, Italy, Japan, Kenya, Korea, Lithuania, Latvia, Malaysia, Mexico, Macao, Netherlands, Nepal, Norway, New Zealand, Oman, Panama, Peru, Poland, Portugal,Paraguay , Philippines, Romania, Russian Federation, Saudi Arabia, Singapore, Spain, Slovakia, Slovenia, Serbia, South Korea, Slovenia, South Africa, Spain, Switzerland, Sri Lanka, Sweden, Taiwan, Thailand, Turkey, United Arab Emirates, Ukraine, USA, UK, Venezuela, Vietnam

CCH
10th June 2010, 19:42