I am encountering the following error with osx-trash.
I am on ruby 1.9.3dev (2011-09-23 revision 33323) [x86_64-darwin12.2.0]
$ gem install osx-trash
Successfully installed osx-trash-1.0.0
1 gem installed
Installing ri documentation for osx-trash-1.0.0...
Installing RDoc documentation for osx-trash-1.0.0...
$ touch foo
$ trash foo
/Users/vng/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- osx/cocoa (LoadError)
from /Users/vng/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/vng/.rvm/gems/ruby-1.9.3-rc1/gems/osx-trash-1.0.0/bin/trash:35:in `<top (required)>'
from /Users/vng/.rvm/gems/ruby-1.9.3-rc1/bin/trash:19:in `load'
from /Users/vng/.rvm/gems/ruby-1.9.3-rc1/bin/trash:19:in `<main>'
from /Users/vng/.rvm/gems/ruby-1.9.3-rc1/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/vng/.rvm/gems/ruby-1.9.3-rc1/bin/ruby_noexec_wrapper:14:in `<main>'
What is osx/cocoa?
The module is known officially as RubyCocoa which is a framework for Mac OS X that allows Cocoa programming in the object-oriented scripting language Ruby.
Normally RubyCocoa should be present in /System/Library/Frameworks.
Probably after upgrading your ruby, they forgot about the the cocoa binding, so try to upgrade your ruby to the latest version or there is some inconsistency between the versions.
You may try to re-install osx-trash by ruby 1.8, e.g.:
See:
If not, try re-installing cocoa via gem (I'm not sure if it's the right cocoa, or newcocoa, or something else):
If won't help, to enable installation of RubyCocoa you’ll need to set a few flags during Ruby installation:
Then try to to configure and install RubyCocoa from the sources:
Now check which version of RubyCocoa you have installed:
If won't work, check the followings: