views:

47

answers:

1

I have installed MacRuby 0.6 and then the hotcocoa gem from Github. However, when I try to create a hotcocoa application with eg.

hotcocoa demoapp

I get the error

-bash: /usr/local/bin/hotcocoa: No such file or directory

Typing 'which hotcocoa' results in

/usr/bin/hotcocoa

Other online documentation seems to suggest that this ought to have been installed to /usr/local/bin so I am confused (a) how it ended up here and (b) why it can't be found even though both locations are in my PATH

I installed hotcocoa with:

sudo macgem install hotcocoa 

I had previously done a gem install by mistake but I uninstalled that when I realised I should be using macgem instead.

echo $PATH

/opt/local/bin:/opt/local/sbin:/usr/local/git/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec

Any thoughts?

Addendum

As an experiment, I also changed the order of the items in the PATH and it can now find hotocoa. My PATH is now...

/usr/local/git/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/local/bin:/bin:/sbin:/usr/sbin:/usr/libexec

..with /usr/bin listed earlier than /usr/local/bin

Of course this still doesn't explain why it couldn't find it before (all the path elements seem to exist) or why it was installed there.

A: 

Thank you for sharing your experience! I've been struggling with the same set of issues and outcomes for a while. Path order was a non-issue in my case.

It appears that for MacRuby 0.7.1 (installed via RVM) with hotcocoa (installed via sudo macgem), the use of 'sudo' is required to avoid potential load errors.

For example:

(1) keying in 'hotcocoa mydemo', displays the 'Could not find RubyGem hotcocoa (>= 0) (Gem::LoadError)' message on my box. Whereas, if I key in 'sudo hotcocoa mydemo', no load error occurs and, Rakefile, config, lib, and resources items can be listed in the 'mydemo' directory.

(2) keying in 'macrake' results in rake aborted: no such file to load -- hotcocoa/application_builder. Whereas, keying in 'sudo macrake' displays the Mydemo window and its 'Hello from HotCocoa' message.

seasonedgeek