没有要加载的文件 -- ruby​​gems (LoadError) [英] no such file to load -- rubygems (LoadError)

查看:27
本文介绍了没有要加载的文件 -- ruby​​gems (LoadError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在 fedora 12 中安装了 rails.我也是 linux 新手.在 Windows 7 上一切正常.但我在 linux 中面临很多问题.请帮忙!

I recently installed rails in fedora 12. I'm new to linux as well. Everything works fine on Windows 7. But I'm facing lot of problems in linux. Help please!

我已根据我的知识安装了所有必需品,以启动并运行基本脚本/服务器.当我尝试脚本/服务器时,我从 boot.rb 中弹出了这个错误.我想在这里提供一些细节:

I've installed all the essentials to my knowledge to get the basic script/server up and running. I have this error from boot.rb popping up when I try script/server. Some of the details I'd like to give here:

rails、ruby 和 gem 的安装目录,

The directories where rails, ruby and gem are installed,

[vineeth@localhost my_app]$ which ruby
/usr/local/bin/ruby

[vineeth@localhost my_app]$ which rails
/usr/bin/rails

[vineeth@localhost my_app]$ which gem
/usr/bin/gem

当我运行脚本/服务器时,这是错误.

And when I run the script/server, this is the error.

[vineeth@localhost my_app]$ script/server
./script/../config/boot.rb:9:in `require': no such file to load -- rubygems (LoadError)
 from ./script/../config/boot.rb:9
 from script/server:2:in `require'
 from script/server:2

PATH 文件是这样的

And the PATH file looks like this

[vineeth@localhost my_app]$ cat ~/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
 . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin/ruby:$PATH"

我想这与 PATH 文件有关.让我知道我需要在这里改变什么.如果我需要做其他更改,请告诉我.

I suppose it is something to do with the PATH file. Let me know what I need to change here. If there are other changes I should make, please let me know.

推荐答案

我预感你有两个 ruby​​ 版本.请粘贴以下命令的输出:

I have a hunch that you have two ruby versions. Please paste the output of following command:

$ which -a ruby

关于评论的更新:

核对一个版本,只留下一个.我有两个版本在不同位置寻找宝石时遇到同样的问题.让我疯狂了几个星期.在 SO 上悬赏赏金给了我同样的答案.

Nuke one version and leave only one. I had same problem with two versions looking at different locations for gems. Had me going crazy for few weeks. Put up a bounty here at SO got me same answer I'm giving to you.

我所做的只是安装了一个 ruby​​,然后通过端口留下了一个可管理的安装.我建议这样做:

All I did was nuke one installation of ruby and left the one managable via ports. I'd suggest doing this:

  1. 删除通过端口(yum 或任何包管理器)安装的 ruby​​ 版本.
  2. 删除操作系统附带的 ruby​​ 版本(手动硬核 rm).
  3. 从具有不同前缀的端口(/usr 而不是 /usr/local)安装 ruby​​ 版本
  4. 重新安装 rubygems
  1. Remove ruby version installed via ports (yum or whatever package manager).
  2. Remove ruby version that came with OS (hardcore rm by hand).
  3. Install ruby version from ports with different prefix (/usr instead of /usr/local)
  4. Reinstall rubygems

这篇关于没有要加载的文件 -- ruby​​gems (LoadError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆