对如何安装 Rails 插件感到困惑 [英] Confused about how to install Rails plugins

查看:38
本文介绍了对如何安装 Rails 插件感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里找到了一个示例如何安装 Rails 插件.他们的例子说明了这一点:

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

./script/plugin install calendar_helper

这对我不起作用,因为令人困惑的是,我的 script 目录中没有任何名为 plugin 的东西.我只有rails:

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

所以Rails 没有附带安装插件所需的脚本?你需要一个插件来安装插件吗?这似乎不太可能.我的 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?

推荐答案

您可能在使用 Rails 3.将 ./script/plugin 替换为 rails plugin.

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

rails plugin install calendar_helper

但另一个问题是插件,与 gems 不同,需要使用完整路径安装.在 Rails 2.x 中也是如此.

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

这篇关于对如何安装 Rails 插件感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆