Jason Swett
Jason Swett

Reputation: 45094

Confused about how to install Rails plugins

I found an example here showing how to install a Rails plugin. Their example shows this:

./script/plugin install calendar_helper

This won't work for me because, confusingly, I don't have anything called plugin in my script directory. All I have is rails:

$ ls script/
rails

So Rails doesn't come with the script you need to install plugins? You need a plugin to install plugins? That doesn't seem very likely. Is something wrong with my Rails project?

Upvotes: 11

Views: 12007

Answers (2)

whitemanliang
whitemanliang

Reputation: 11

You should first input text like gem 'calendar_helper' in your Gemfile, and then run bundle install for rails 3.0

Upvotes: 0

Brian Morearty
Brian Morearty

Reputation: 3348

You're probably on Rails 3. Replace ./script/plugin with rails plugin.

rails plugin install calendar_helper

But the other problem is plugins, unlike gems, need to be installed with a full path. This was also true in Rails 2.x.

rails plugin install https://github.com/topfunky/calendar_helper.git

Upvotes: 21

Related Questions