Windows Gem 安装

发布于 2024-09-26 17:14:10 字数 488 浏览 5 评论 0原文

我是 Ruby on Rails 的新手。我有一个关于安装 gem 的快速问题。

我使用的是带有 Ruby 1.9.2 和 Rails 3.0 的 Windows 7 64 位计算机,并且我正在尝试安装 gravatar_image_tag gem

gem install gravatar_image_tag

我运行后它说它成功了。但是当我尝试这样做时:

gravatar_image_tag -v

它说 'gravatar_image_tag' 未被识别为内部或外部命令、可操作程序或批处理文件'

当我查看时在我的 ruby​​192/bin 文件中,有 Rails、注释等的批处理文件,可以正常工作,但没有 gravatar_image_tag 的批处理文件。

我想知道我哪里出了问题。

提前致谢。

I'm a newbie to Ruby on Rails. I had a quick question about installing gems.

I'm using a windows 7 64 bit machine with Ruby 1.9.2 and Rails 3.0 and I'm trying to install the gravatar_image_tag gem.

gem install gravatar_image_tag

After I run that it says its succcessful. But when I try to do this:

gravatar_image_tag -v

It says that 'gravatar_image_tag' is not recognized as an internal or external command, operable program or batch file'

When i looked into my ruby192/bin file there are batch files for rails, annotate etc etc that work fine but there's not batch file for gravatar_image_tag.

I was wondering where I'm going wrong with this.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

缺⑴份安定 2024-10-03 17:14:11

并非所有 gem 都可以从命令行执行。查看 gem 是否已安装(及其版本)的最佳方法是运行:

gem list

Not all gems are executable from the command line. The best way to see if a gem is installed (as well as its version) is to run:

gem list
舂唻埖巳落 2024-10-03 17:14:11

如果您想在 Rails 3 项目中使用 gem,您应该将其添加到您的 Gemfile (在项目的根目录中)。类似这样的事情

gem "gravatar_image_tag"

然后运行bundle install

gravatar_image_tag 应放置在您视图中的某个位置,以生成正确的 html。

更多信息请访问其 github 页面

[编辑]也许我的回答不太重要。要检查 gem 是否已正确安装,您可以键入

gem list gravatar_image_tag

bundle show gravatar_image_tag

是否使用捆绑器安装了 gem。

并非所有 gems 都会安装批处理文件,根据文档,这也不会。

If you want to use a gem inside your rails 3 project, you should add it to your Gemfile (in the root of your project). Something like this

gem "gravatar_image_tag"

then run bundle install.

The gravatar_image_tag should placed somewhere in your view, to generate the correct html.

More information can be found on their github page.

[EDIT] Maybe my answer was not too the point. To check if the gem was correctly installed, you either type

gem list gravatar_image_tag

or

bundle show gravatar_image_tag

if you installed the gem using bundler.

Not all gems install a batch-file, and according to the documentation this doesn't either.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文