Git Product home page Git Product logo

Comments (15)

bdtomlin avatar bdtomlin commented on August 21, 2024 2

I also use rbenv and zsh and was having the same issue. This is how I got the test runner to work.

First, go ahead and configure bash to use rbenv by adding the following to ~/.bash_profile

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

Second, change the commands in the ruby test settings and prefix them with bundle exec.

That's it. All works as planned.

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

Interesting. It looks like Ruby Test is incorrectly assuming rbenv is installed in bash. Installing rbenv in bash seems like that would have fixed it, but apparently not. It could be that it really wasn't installed properly in bash?

Can you try modifying Ruby Test to get it to work with zsh? In Atom's settings, select the Ruby Test package and click the "Open in Atom" button. It'll open an editor window to the Ruby Test source code. From there open the lib/shell-runner.coffee file. Edit the spawn call (line 22) to use zsh instead of bash. Not sure what the correct flags are for zsh. For bash, the -l flag is necessary. Then back to your project's editor window, hit Ctrl+Alt+Cmd+L, then try to run your tests. If that works, then we know basically what needs to happen to get Ruby Test to work with zsh.

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

Just to check whether rbenv is set up correctly, run: bash -l -c "which ruby" from zsh. It should return the rbenv-supplied ruby path. If instead it returns the system Ruby, then rbenv is not set up correctly in Bash.

from atom-ruby-test.

jeremywrowe avatar jeremywrowe commented on August 21, 2024

I am using homebrew to manage RBENV bash -l -c "which ruby" returns /usr/bin/ruby. but when I login to an interactive shell which ruby returns /Users/jrowe/.rbenv/shims/ruby the correct ruby. I think there is another piece to the puzzle. An overridable ruby path would be awesome for the plugin.

from atom-ruby-test.

dsandstrom avatar dsandstrom commented on August 21, 2024

Re: zsh. I'm using rbenv and zshell and tried as you suggested, change the spawn command. But I get

zsh: command not found: bundle

(I prepended my rspec commands with bundle exec.) The login shell flag is the same for zsh, -l, so I don't think that is it. I couldn't find any examples online of node.js' spawn command with zsh. However, setting up rbenv in bash works for now.

from atom-ruby-test.

dsandstrom avatar dsandstrom commented on August 21, 2024

Yes, works fine in bash. But, I figured out how we can use different
shells. PR coming.
On Aug 6, 2014 11:59 AM, "Bryan Tomlin" [email protected] wrote:

I also use rbenv and zsh and was having the same issue. This is how I got
the test runner to work.

  1. Go ahead and configure bash to use rbenv by adding the following to
    ~/.bash_profile

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

  1. Change the commands in the ruby test settings and prefix them with
    bundle exec.

That's it. All works as planned.


Reply to this email directly or view it on GitHub
#14 (comment)
.

from atom-ruby-test.

dsandstrom avatar dsandstrom commented on August 21, 2024

Shell option added with #22

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

Everybody who is interested in this feature, can you please test #22 and provide feedback on the PR?

from atom-ruby-test.

dsandstrom avatar dsandstrom commented on August 21, 2024

The best way to try out a non-official package or a branch is to:

  1. Uninstall package with apm or Atom settings view
  2. Download/clone package repo
  3. Checkout branch if not master
  4. Run apm link from repo directory.

Correct me if there is a better way.

In this case the repo is here: https://github.com/dsandstrom/atom-ruby-test/tree/add-buffered-back . And branch is add-buffered-back.

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

This should work in version 0.9.0. Feel free to post comments on this issue if it doesn't.

from atom-ruby-test.

dsandstrom avatar dsandstrom commented on August 21, 2024

Thanks @moxley. I noticed that atom needs to be reloaded or restarted for the shells to change. Maybe related to: #5 .

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

This might be the problem: https://github.com/moxley/atom-ruby-test/pull/22/files#diff-5f529e8b1852dcd35a9c63226d9aba83R10

The shell configuration value is assigned to a static property, currentShell, rather than read from a function call, like cwd is. Changing currentShell to a function fixes the problem.

However, there is now an environment issue. The shell can't find the rspec command, presumably because rvm isn't properly loaded. I'll continue to investigate that issue.

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

I think the two issues are resolved, now published as version 0.9.1. Let me know if there are any more issues.

from atom-ruby-test.

jeremywrowe avatar jeremywrowe commented on August 21, 2024

👍! Sorry I haven't had time to look into this further.

from atom-ruby-test.

dsandstrom avatar dsandstrom commented on August 21, 2024

Yep, I forgot the -l flag. I also noticed the run-command package has a -i (interactive), which might be needed.

Something to note for users, this will probably only work for bash like shells (ones that use -c to run a command from a string).

from atom-ruby-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.