pezra / rspec-mode

An RSpec minor mode for Emacs
256 stars 112 forks source link

zeus command not found, ./bin/zeus works #39

Open teaforthecat opened 11 years ago

teaforthecat commented 11 years ago

Because

using ./bin/zeus works where 'zeus' doesn't.

Is there another way to get the ./bin directory on the path?

see commit:https://github.com/teaforthecat/rspec-mode/commit/20bbc8fd1d50757bcd0dc8fa14918dbed2ebd237

dgutov commented 11 years ago

the path does not seam to be getting set from an environment variable in .bashrc

Looks like a problem in your setup.

Is there another way to get the ./bin directory on the path?

Do you use RVM? http://robots.thoughtbot.com/post/15346721484/use-bundlers-binstubs http://blog.davidchelimsky.net/2011/07/18/stop-typing-bundle-exec/

teaforthecat commented 11 years ago

Those are good suggestions. I do use rvm and I it is integrated with bundler. project$ zeus rspec works in shell-mode. Is there a way to see the environment of a compilation buffer? here is my setup using el-get:

   (:name rspec-mode
          :type github
          :pkgname "teaforthecat/rspec-mode"
          :after(progn
                  (setq rspec-use-rvm t)
                  (setq rspec-use-opts-file-when-available nil)
                  (setq rspec-use-bundler-when-possible nil)
                  (setq rspec-use-rake-flag nil)))

note that I have two commits that were required to get rspec-verify working with zeus: https://github.com/teaforthecat/rspec-mode/commit/8611e5b3957f5de05657cf80a29713cf29f32985 https://github.com/teaforthecat/rspec-mode/commit/20bbc8fd1d50757bcd0dc8fa14918dbed2ebd237

dgutov commented 11 years ago

Is there a way to see the environment of a compilation buffer?

Evaluating process-environment in the compilation buffer should do that. But please disregard the suggestion of modifying PATH in .bashrc. If that worked, we wouldn't have to use rvm.el.

And looking at the rvm.el code, it doesn't seem to support changing the path for binstubs. Maybe add a feature request there?

note that I have two commits that were required to get rspec-verify working with zeus:

The second one looks incomplete: it obviously breaks the non-binstubs usage of zeus. The first one, on the other hand, looks generally useful. zeus doesn't accept additional command line arguments, right?

By the way, does using binstubs really eliminate the speed bump of bundle exec for you? According to the comments on the thoughtbot post, the only advantage (on MRI) is less typing.

pedz commented 11 years ago

This is not ready for prime time but here is my solution... A set of bash functions here:

https://github.com/pedz/bash-setup/blob/master/bash_prvm

and a matching emacs file here:

https://github.com/pedz/emacs-lisp/blob/master/pedz/prvm.el

There is a very good chance that there are dependencies that I haven't caught let. The comment in the bash file should tell you what I'm attempting to do.

This is raw rough code... please be gentle with your comments :-)

I am having pretty good luck with most of my environment but its only a few days old.

HTH pedz

stantona commented 10 years ago

Not only am I also having issues not finding zeus, I can not find bundle. I am using zsh but applied the script as suggested. The only difference is that I am using rbenv instead of rvm. I don't particularly know where to begin to try and diagnose this issue.

dgutov commented 10 years ago

Not only am I also having issues not finding zeus, I can not find bundle.

First, try moving your rbenv setup from .bashrc to .profile and relogin/reboot. If that doesn't help, try the instruction here: http://blog.senny.ch/blog/2013/02/11/use-the-right-ruby-with-emacs-and-rbenv/

dgutov commented 9 years ago

Other configuration options aside, there's a standard approach to use binstubs: add ./bin to PATH (or whatever different directory they're in in your project).

And see https://github.com/thoughtbot/dotfiles/pull/215 for a bit more security-minded approach.

If Emacs doesn't pick up this addition, one can also modify exec-path in their init file.

Not sure if all of this is hard enough for rspec-mode to have to provide dedicated support (which should amount to a new option, and prepending to exec-path locally in rspec-compile).