简体   繁体   English

如何安装Ruby on Rails插件?

[英]How do you install Ruby on Rails plugins?

I am trying to install the has_calendar plugin, and it says that is successfully installing. 我正在尝试安装has_calendar插件,它说安装成功。 However, when I have a page with code the plugin should execute, I am returned errors of undefined functions. 但是,当我有一个页面应包含插件应执行的代码时,会返回未定义函数的错误。

Is there somewhere I need to reference the plugin as a helper? 我需要在哪里引用插件作为帮助程序?

Here the sample code, straight off the wiki page. 这里是示例代码,直接在Wiki页面上。

<%= calendar :year => 2010, :month => 9 %>

You need to be sure to restart your app after installing a plugin. 安装插件后,您需要确保重新启动应用程序。 You can do this by restarting the application server, or, if you're using passenger, touch tmp/restart.txt . 您可以通过重新启动应用程序服务器来完成此操作,或者,如果您使用的是乘客,请touch tmp/restart.txt

You shouldn't need to add any references, unless the plugin's readme specifically asks for them. 除非插件的自述文件特别要求它们,否则您无需添加任何引用。

You can ensure that the plugin is installed by checking the vendor/plugins/ directory to for a directory with your plugin's name. 您可以通过检查vendor/plugins/目录以找到带有您插件名称的目录来确保已安装该插件。 If it's not there, you may not have the proper SCM installed, which would be required to download the repository. 如果不存在,则可能没有安装正确的SCM,下载存储库可能需要安装SCM。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM