[英]Rails “Missing these required gems” error for installed gems
I know this has been asked multiple times before, but I've tried those things and still am not having any luck. 我知道之前已经多次询问过,但我已经尝试过这些东西,但仍然没有运气。
For the mechanize
gem, I keep getting the "Missing these required gems" error when I run db:migrate
on my production server. 对于mechanize
gem,当我在生产服务器上运行db:migrate
时,我不断收到“Missing these required gems”错误。
Here's the full error: 这是完整的错误:
Missing these required gems:
mechanize
You're running:
ruby 1.8.6.111 at /usr/bin/ruby1.8
rubygems 1.3.5 at /home/user/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8
Output of which ruby
is /usr/bin/ruby
which ruby
输出是/usr/bin/ruby
Output of which gem
is /usr/bin/gem
which gem
输出是/usr/bin/gem
When I run gem list
mechanize (1.0.0)
is definitely in the list. 当我运行gem list
mechanize (1.0.0)
肯定在列表中。
What am I doing wrong here? 我在这做错了什么?
There is a chance that you may require i different version of the mechanize gem. 您可能需要我不同版本的机械宝石。 Try to work out what version of the gem its looking for. 尝试找出它寻找的宝石版本。
您可能需要不同的版本,请尝试
rake gems:install
What's the output of which rake
? 什么是which rake
的输出?
The output of which ruby
is /usr/bin/ruby
, while the rake task reports /usr/bin/ruby1.8
. which ruby
的输出是/usr/bin/ruby
,而rake任务报告/usr/bin/ruby1.8
。 Unless one is a symlink to the other, I suspect something is awry in your environment. 除非一个是另一个的符号链接,否则我怀疑你的环境中存在一些问题。
Also, looks like you have some gems installed in your user folder. 此外,看起来您的用户文件夹中安装了一些gem。 Have you tried installed the gem system-wide with sudo gem install
or sudo rake gems:install
? 您是否曾尝试使用sudo gem install
或sudo rake gems:install
gem系统范围sudo rake gems:install
?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.