[MacRuby-devel] (Mac)?Gems in the same place

Iain Barnett iainspeed at gmail.com
Tue Sep 21 07:11:11 PDT 2010


On 15 Sep 2010, at 22:37, Iain Barnett wrote:

> 
> I'll install via macgems by adding the --install-dir option. Thanks for letting me know they shouldn't mix.

I'm getting some problems while trying to install hotcocoa this way. I've posted all the commands I went through below with output, but it ends up that hotcocoa only works if it's where the MatzRuby gems sit.

Does anyone know where I can look to see why this is?

> 
> 
> Yep, it's exactly the same because I've a .gemrc and some env vars set in my .profile too. 

I also realised I was mistaken before when saying macgem env and gem env return exactly the same output, macgem env returns an extra field RUBYGEMS PREFIX which is set to the current dir. Any idea what this is for?

------------

At this point I delete everything in the ~/.macgems dir to start clean.

$ macgem install hotcocoa -r --install-dir ~/.macgems
Successfully installed hotcocoa-0.5.1
1 gem installed

$ hotcocoa testingHotCocoa    
Could not find RubyGem hotcocoa (>= 0)
 (Gem::LoadError)

Just to check...
$ ~/.macgems/bin/hotcocoa      
Could not find RubyGem hotcocoa (>= 0)
 (Gem::LoadError)

$ macgem uninstall hotcocoa     
ERROR:  While executing gem ... (Gem::InstallError)
    cannot uninstall, check `gem list -d hotcocoa`
cannot uninstall, check `gem list -d hotcocoa` (Gem::InstallError)

Again, I delete everything in ~/.macgems and decide to try installing in ~/.gems where I keep gems for Matz's Ruby.

$ macgem install hotcocoa -r  
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - open() failed
Permission denied - open() failed (Errno::EACCES)

$ sudo macgem install hotcocoa -r
Password:
Successfully installed hotcocoa-0.5.1
1 gem installed

I don't usually need sudo to install in the dir with MatzRuby gems, so I'm wondering why the error?

$ hotcocoa testingHotCocoa

No news is good news! It works (so far), but now I have to keep track of a mixture of gems :(


$ macgem env                                                                                                                  /Volumes/RubyProjects
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.9.0 (2008-06-03 patchlevel 0) [universal-darwin10.0]
  - INSTALLATION DIRECTORY: /Users/iainuser/.gems
  - RUBYGEMS PREFIX: /Volumes/RubyProjects
  - RUBY EXECUTABLE: /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin/macruby
  - EXECUTABLE DIRECTORY: /Users/iainuser/.gems/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-10
  - GEM PATHS:
     - /Users/iainuser/.gems
     - /Users/iainuser/.gems/gems
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gemhome" => "/Users/iainuser/.gems"
     - "gem" => "--local --gen-rdoc --run-tests"
     - "rdoc" => "--inline-source --line-numbers"
     - "gempath" => ["/Users/iainuser/.gems", "/Users/iainuser/.gems/gems"]
     - :sources => ["http://gemcutter.org", "http://gems.rubyforge.org/", "http://gems.github.com"]
  - REMOTE SOURCES:
     - http://gemcutter.org
     - http://gems.rubyforge.org/
     - http://gems.github.com

Regards,
Iain






More information about the MacRuby-devel mailing list