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

查看:14
本文介绍了没有要加载的文件——rubygems (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. 从不同前缀的端口安装 ruby​​ 版本(/usr 而不是 /usr/local)
  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

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

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