简体   繁体   English

宝石安装正常,但不显示为在rake宝石下安装

[英]Gems install fine but don't show as installed under rake gems

I'll show you my output here: 我将在这里向您展示我的输出:

rake gems
(in /Users/jp/Sites/central/trunk)
  - [F] authlogic 
    - [R] activesupport 
  - [F] builder 
  - [F] formtastic 
    - [R] activesupport >= 2.3.0
    - [R] actionpack >= 2.3.0
  - [ ] fastercsv 

 I = Installed
 F = Frozen
 R = Framework (loaded before rails starts)

Making sure fastercsv is installed: 确保安装了fastcsv:

gem which fastercsv
/usr/local/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/fastercsv.rb

After installing through a variety of methods but only one is shown here: 通过多种方法安装后,此处仅显示一种:

sudo rake gems:install
(in /Users/jp/central/trunk)
gem install fastercsv
Successfully installed fastercsv-1.5.3
1 gem installed
Installing ri documentation for fastercsv-1.5.3...
Installing RDoc documentation for fastercsv-1.5.3...

And try it again. 然后再试一次。

rake gems
(in /Users/jp/Sites/central/trunk)
  - [F] authlogic 
    - [R] activesupport 
  - [F] builder 
  - [F] formtastic 
    - [R] activesupport >= 2.3.0
    - [R] actionpack >= 2.3.0
  - [ ] fastercsv 

 I = Installed
 F = Frozen
 R = Framework (loaded before rails starts)

One thing to know is that I tried unpacking the gems but if it doesn't think it's installed it can't unpack it. 要知道的一件事是,我尝试拆开宝石的包装,但是如果它不认为已安装,则无法解压。

Another thing is that I really tried to figure this out. 另一件事是我真的试图弄清楚这一点。 There's a bunch of people saying clean up local gems in your user account, always install with sudo, etc. But I've tried all that. 有一堆人说清理您的用户帐户中的本地gem,始终使用sudo进行安装,等等。但是我已经尝试了所有这些。

What would you guys do to fix this? 你们将如何解决此问题?

Thanks many times over, 多谢了

Josh 玩笑

Although I couldn't get this to work I suppose if I deleted all of my gems from my entire system and started fresh, that I could have gotten it to work. 尽管我无法使它正常工作,但我想,如果我从整个系统中删除了所有的gem并重新开始,那我可以使它正常工作。 But I figured since I was doing that anyway, why not try something new. 但是我一直以来都认为,为什么不尝试一些新的东西。

That newness came in the form of RVM (Ruby Version Manager): http://rvm.beginrescueend.com/ 这种新颖性以RVM(Ruby版本管理器)的形式出现: http : //rvm.beginrescueend.com/

RVM, basically, is a layer between your ruby/rails/gems and your application. 基本上,RVM是红宝石/轨道/宝石与应用程序之间的一层。 It allows you to install multiple versions of ruby and rails on your system and switch between them seamlessly. 它允许您在系统上安装多个版本的红宝石导轨,并在它们之间无缝切换。 You can also set up individual 'GemSets' for each of these installations (or multiple GemSets for one installation). 您还可以为这些安装中的每个安装设置单个“ GemSet”(或为一个安装设置多个GemSet)。 Very powerful stuff. 非常强大的东西。

In addition, you don't use sudo to install the gems so I find it better if not for that reason alone. 另外,您不使用sudo来安装gems,所以如果不是因为这个原因,我会发现它更好。

So I got started with RVM and it allowed me to start from scratch (probably quicker than without it) and gives me expansion ability in the future to test multiple environments and gems, etc. 因此,我开始使用RVM,它使我可以从头开始(可能比没有它更快),并且在将来为我提供了扩展能力以测试多个环境和gems等。

Check out the site and give it a go if you're having gem hell issues. 如果您遇到宝石地狱的问题,请访问该网站并尝试一下。

Josh 玩笑

这将起作用: config.gem "fastercsv", :version => '1.5.3', :lib => 'fastercsv'

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

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