简体   繁体   English

如何在Rails 4中安装gem?

[英]How to install gem in rails 4?

How do you install plugins in Rails 4? 如何在Rails 4中安装插件? Or more specifically, how do you install the Princely plugin for PrinceXML? 更具体地说,如何为PrinceXML安装Princely插件? I've spent a lot of time Googling but have not come up with anything. 我花了很多时间在Google搜寻,但没有提出任何建议。 Everything seems to be for earlier versions of Rails. 一切似乎都适用于Rails的早期版本。 I get the impression that one would put in in the Gem file somehow? 我觉得有人会以某种方式放入Gem文件中? If someone could clarify this for me, I'd be most appreciative. 如果有人可以为我澄清这一点,我将不胜感激。

Gemfile 宝石文件

gem 'princely', '~> 1.4.1'  

or if you prefer to point to github 或者如果您想指向github

gem 'princely', github: 'mbleigh/princely'

then run bundle install 然后运行bundle install

Go to into your gemfile, do what Antarr Byrd said. 进入您的gemfile,执行Antarr Byrd所说的。 Basically put in those lines above or below and of the lines about gems already there. 基本上在那些已经存在的宝石之上或之下的行中。 Running bundle install will result in a new Gemfile.lock, at which point it'll start working. 运行软件包安装将产生一个新的Gemfile.lock,从那时起它将开始工作。

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

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