fcoury / atom-rspec

Atom RSpec runner package
MIT License
69 stars 42 forks source link

Not working with oh-my-zsh #83

Open jiamingz42 opened 8 years ago

jiamingz42 commented 8 years ago

I am using oh-my-zsh as my default shell. When I run this plugin in Atom, I saw this error message

/Users/jiamingz/.oh-my-zsh/oh-my-zsh.sh: line 12: autoload: command not found
/Users/jiamingz/.oh-my-zsh/oh-my-zsh.sh: line 31: syntax error near unexpected token `('
/Users/jiamingz/.oh-my-zsh/oh-my-zsh.sh: line 31: `for config_file ($ZSH/lib/*.zsh); do'
bash: line 1: undefined: command not found
ryanclark2 commented 8 years ago

+1 Same issue

matugm commented 8 years ago

I think this problem is related to this line of code:

https://github.com/fcoury/atom-rspec/blob/9fe69f2d17288a1ba31eb9de15c118b818843fee/lib/rspec-view.coffee#L90

command is probably undefined, can you try manually setting your rspec command in the plugin configuration? Just rspec will do.

ryanclark2 commented 8 years ago

Yup, that worked. I added the

'rspec':
  'command': 'bundle exec rspec'

snippet to my config and it works now. Any idea how to bypass .zshrc so that I don't get the above errors/warnings at the start of my specs?

kholbekj commented 8 years ago

I'm running fish, and I can't get it to work even with that snippet. I just get bash: line 1: undefined: command not found

cdeliens commented 8 years ago

Same problem as @kholbekj here

lucasmartins commented 8 years ago

@kholbekj & @cdeliens, you may have to give it some context, I'm using chruby on OSX, so I set it up like this:

  'rspec':
    'command': 'source /usr/local/opt/chruby/share/chruby/chruby.sh && chruby `cat .ruby-version` && bundle exec rspec'
devmarwen commented 8 years ago

Add this to your config file:

'rspec':
  'command': 'bash; rspec'
Elisabetta87 commented 7 years ago

I've got the same problem, can anyone help me? I'm trying to install a new theme (cobalt2) for zsh shell and when I types source ~/.zshrc I got the "command autoload not found" error I'm not getting where/how to fix this probelm

bbugh commented 7 years ago

For anyone else still running into this, the snippet for the rspec config needs to be indented as part of the '*' block. Do it like this (notice indentation):

"*":
  rspec:  
    command: "bundle exec rspec"

Not like this:

rspec:
  command: "bundle exec rspec"
auipga commented 6 years ago

Sourcing .zshrc from bash results in the same error. So you need to start zsh first!

buglovebug commented 4 years ago

I just encountered the same, the reason is default shell not zsh, use chsh -s to change default shell to zsh