Confused about how to install Rails plugins

浪子不回头ぞ 提交于 2020-01-12 07:00:07

问题


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?


回答1:


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



回答2:


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



来源:https://stackoverflow.com/questions/4693431/confused-about-how-to-install-rails-plugins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!