简体   繁体   中英

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:

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.

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. 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, basically, is a layer between your ruby/rails/gems and your application. 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). 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.

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.

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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