views:

47

answers:

2

I am trying to install LESS in a Ruby on Rails project. I am able to run the gem successfully, but when I try to install the plugin for LESS, I get an error. Here's what shows in the terminal:

MacBook:benji jesse$ sudo gem install less
Successfully installed less-1.2.21
1 gem installed
Installing ri documentation for less-1.2.21...
Installing RDoc documentation for less-1.2.21...
MacBook:benji jesse$ sudo script/plugin install git://github.com/cloudhead/more.git
sudo: script/plugin: command not found

I am a .NET developer trying to learn Ruby on Rails (on a Mac), so I am new to all this stuff.

My question's are:

  • Is the script/plugin command a standard command?
    • What does it do?
    • Where can I learn more about this command?
  • Why does it say command can't be found?
A: 

You have to be in the application directory. Say you created your rails app in the folder development/rails_app. You must execute the script/plugin command from there (and you don't need super user permissions for that):

cd development/rails_app
script/plugin install git://github.com/cloudhead/more.git

The plugin installation will apply only to the current rails application (in this case, rails_app). So if you create another application, you must run the script/plugin command again.

Hugo Peixoto
+1  A: 

Is the script/plugin command a standard command?

It is in rails 2, it has changed in rails 3:

rails plugin
# or
script/rails plugin

What does it do?

installs the given plugin into the RAILS_ROOT/vendor/plugin, but you should look if there is a gem version of the plugin, than you can add a gem dependency to this gem.

Where can I learn more about this command?

run the command without any parameters

Why does it say command can't be found?

try ls script/ and see if the file exists.

jigfox