[英]In a Ruby on Rails installation, what is causing webrick to be outdated and why `gem i webrick` can update it?
I have a new Mac computer and installed rails on it, and then I tried out the command我有一台新的Mac电脑并在上面安装了rails,然后我尝试了命令
gem outdated
for some reason, it showed one of the gems outdated:出于某种原因,它显示了其中一个已过时的宝石:
webrick (1.4.2 < 1.6.0)
I wonder why it is outdated on the first installed, and when I did我想知道为什么它在第一次安装时就已经过时了,我什么时候安装的
sudo gem install webrick
it actually installed 1.6.0 onto the system.它实际上将 1.6.0 安装到系统上。 Doesn't it require
gem update
instead of install
to update something?它不需要
gem update
而不是install
来更新一些东西吗? How come install
also updated it?怎么
install
也更新了?
Not exactly, gem install GEM_NAME
will install the last version available if you don't specify a version when installing, and you can have more than 1 version of the same gem on your machine.不完全是,如果您在安装时未指定版本,
gem install GEM_NAME
将安装可用的最后一个版本,并且您的机器上可以有多个相同的 gem 版本。
you can run gem environment
, and check where gems are installed, go to that folder and you will see both version gems folder there.您可以运行
gem environment
,并检查 gem 的安装位置,go 到该文件夹,您将在那里看到两个版本的 gems 文件夹。
so when you create a rails project for example and add a specific version of a gem in the gemfile
and another version on another project, you can have both without problems因此,例如,当您创建一个 rails 项目并在
gemfile
中添加特定版本的 gem 并在另一个项目中添加另一个版本时,您可以毫无问题地同时拥有这两个版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.