简体   繁体   English

rails在rvm配置中找不到已安装的gem

[英]rails cannot find installed gem in rvm configuration

I split my development between two machines with a Bitbucket-hosted git repo to make sure they're in sync: 我使用Bitbucket托管的git repo在两台机器之间拆分我的开发,以确保它们是同步的:

  • Linux Mint Linux Mint
  • Bash on Ubuntu on Windows 10 在Windows 10上使用Ubuntu进行Bash

I've got my Gemfile , Gemfile.lock , .ruby-version , and .ruby-gemset set up to peg both environments to the same configuration (ruby 2.4.0 and a gemset called cs2 ). 我已经将我的GemfileGemfile.lock.ruby-version.ruby-gemset设置为将两个环境挂钩到相同的配置(ruby 2.4.0和一个名为cs2的gemset)。

I've added the following to my Gemfile : 我已将以下内容添加到我的Gemfile

gem 'google_drive'

and bundle install runs successfully: bundle install成功运行:

...
Using google_drive 2.1.5
...

On the Win 10 machine, I can then run rails c to get to the console, but on the Linux Mint machine I'm met with: 在Win 10机器上,我可以运行rails c进入控制台,但在Linux Mint机器上我遇到了:

Could not find google_drive-2.1.5 in any of the sources
Run `bundle install` to install missing gems.

Clearly I have a misconfiguration somewhere on my Linux Mint machine, but I'm not sure how to find the problem. 显然我的Linux Mint机器上的某个地方有误配置,但我不确定如何找到问题。 It only seems to be the one gem, too. 它似乎也只是一颗宝石。 I tried to empty the gemset and rebuild it and I see the same problem. 我试图清空gemset并重建它,我看到了同样的问题。 I tried deleting the gemset and, again, I see the same thing. 我尝试删除gemset,再次,我看到同样的事情。 Any ideas? 有任何想法吗? I tried running gem install google_drive --version 2.1.5 and still no luck. 我尝试运行gem install google_drive --version 2.1.5但仍然没有运气。

What else can I try? 我还能尝试什么? Why could this be happening? 为什么会发生这种情况?

请运行'rvm current'检查当前的gemset是否为linux上的cs2并删除Gemfile.lock并重新运行bundle install

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

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