tnwinc / Isolate

Isolate is a tool to allow injection of module dependencies when doing Test Driven Javascript/Coffeescript development.
44 stars 3 forks source link

"command not found : coffee" error when running rake #3

Open bigfish opened 11 years ago

bigfish commented 11 years ago

I just cloned the repo, did 'bundle install' and 'npm install' but when I try to build the .js files, I get the error:

bundler: command not found: coffee Install missing gem executables with bundle install

Any idea what I'm doing wrong, or is this a bug?

Using Ubuntu 12.04, ruby 1.9.3 (RVM) and gem 1.8.24

JamesMaroney commented 11 years ago

When in the Isolate directory, what do you get when you do a bundle list?

bigfish commented 11 years ago
JamesMaroney commented 11 years ago

Interesting. The Rakefile executes bundle exec coffee --compile --output . src/isolate.coffee though you do have the coffee-script gem installed. What happens if you try bundle exec coffee --version ?

bigfish commented 11 years ago

I get the same error

bundle exec coffee --version

bundler: command not found: coffee Install missing gem executables with bundle install

bigfish commented 11 years ago

Bundler version 1.3.4

JamesMaroney commented 11 years ago

@brendanjerwin any ideas on what might be amiss here? I'm drawing a blank.

jacebennett commented 11 years ago

I can reproduce this on Ubuntu 13.04 without rvm and the latest everything else. Checking it out.

Gems included by the bundle:
  * bundler (1.3.4)
  * coffee-script (2.2.0)
  * coffee-script-source (1.3.3)
  * execjs (1.4.0)
  * guard (1.4.0)
  * guard-coffeescript (1.2.0)
  * listen (0.5.2)
  * multi_json (1.3.6)
  * rb-fsevent (0.9.1)
  * ruby_gntp (0.3.4)
  * thor (0.16.0)
jacebennett commented 11 years ago

So the gem no longer provides an executable (I think I knew that once). We have to use the node module.

npm install -g coffee-script would work presumably.

running export PATH="./node_modules/.bin:$PATH" fixes it in my environment, and http://stackoverflow.com/questions/9679932/how-to-use-package-installed-locally-in-node-modules seems to suggest this is the preferred solution. I don't particularly like it myself.

We could update the Rakefile to explicitly call the one in the node_modules/.bin, I suppose. Thoughts?

jacebennett commented 11 years ago

This works in bash, but my rake-fu is weak.

`npm bin`/coffee
jacebennett commented 11 years ago

@bigfish Can you check it out in the branch for #4? I want to make sure this works in windows (it probably won't) before I pull it in, but I don't have that environment handy atm.

JamesMaroney commented 11 years ago

Ah, thanks Jace, good find. If this works out we can get the rakefile updated tonight.

bigfish commented 11 years ago

I checked out the npm-path-for-rake-tasks branch and I was able to run rake successfully to compile isolate.js. This was on my home Ubuntu box running 12.10 but otherwise pretty much the same as previously mentioned... node 0.8 ruby 1.9.3 (from RVM). It still has the same issue on the master branch so I'd say this fixes the problem. Thanks for dealing with this so quickly.

I noticed there's also an npm package version of this.. is this only for use in node?

JamesMaroney commented 11 years ago

We use this to test require-js based AMD modules for the browser (though we run the tests in node) There has also been some success using this to help in testing common-js modules.

I'll merge this into master after doing some more testing.

Let us know if you hit any more issues using Isolate!

pegasuspect commented 8 years ago

Thanks @bnwasteland =)