Comments (10)
Works for me. I'm not a chruby user, but I tried it out, removing rbenv first. Check out the steps I took and see if there is anything you might be doing differently:
-
Remove rbenv files:
rm -rf ~/.rbenv
-
Remove these lines from
~/.bash_profile
:export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
-
Close and reopen shell.
-
Verify the system Ruby:
~ $ which ruby /usr/bin/ruby ~ $ ruby --version ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
-
Install chruby with Homebrew:
brew update brew install chruby
-
Add the following line to
~/.bash_profile
:source /usr/local/opt/chruby/share/chruby/chruby.sh
-
Install Ruby MRI 2.1.2:
brew install gdbm libffi libyaml openssl readline wget wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2 tar -xjvf ruby-2.1.2.tar.bz2 cd ruby-2.1.2 ./configure --prefix="$HOME/.rubies/ruby-2.1.2" --with-opt-dir="$(brew --prefix openssl):$(brew --prefix readline):$(brew --prefix libyaml):$(brew --prefix gdbm):$(brew --prefix libffi)" make sudo make install
-
Add the following line to
~/.bash_profile
:chruby ruby-2.1.2
-
Restart shell.
-
Verify Ruby:
~ $ ruby --version ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] ~ $ which ruby /Users/moxley/.rubies/ruby-2.1.2/bin/ruby
-
Install bundler:
gem install bundler
-
Install project gems:
cd ~/projects/bands bundle
-
Verify rspec:
~/projects/bands git:master(0) $ which rspec /Users/moxley/.gem/ruby/2.1.2/bin/rspec
-
Quit and restart Atom
-
Run test tests for a given test file:
Cmd+Ctrl+T
from atom-ruby-test.
Hmm... I'll try when I get in front of a computer ASAP. Could it be due to me using zshell instead of bash?
On Jul 16, 2014, at 15:23, Moxley Stratton [email protected] wrote:
Works for me. I'm not a chruby user, but I tried it out, removing rbenv first. Check out the steps I took and see if there is anything you might be doing differently:
Remove rbenv files:
rm -rf ~/.rbenv
Remove these lines from ~/.bash_profile:export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
Close and reopen shell.Verify the system Ruby:
~ $ which ruby
/usr/bin/ruby
~ $ ruby --version
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
Install chruby with Homebrew:brew update
brew install chruby
Add the following line to ~/.bash_profile:source /usr/local/opt/chruby/share/chruby/chruby.sh
Install Ruby MRI 2.1.2:brew install gdbm libffi libyaml openssl readline wget
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2
tar -xjvf ruby-2.1.2.tar.bz2
cd ruby-2.1.2
./configure --prefix="$HOME/.rubies/ruby-2.1.2" --with-opt-dir="$(brew --prefix openssl):$(brew --prefix readline):$(brew --prefix libyaml):$(brew --prefix gdbm):$(brew --prefix libffi)"
make
sudo make install
Add the following line to ~/.bash_profile:chruby ruby-2.1.2
Restart shell.Verify Ruby:
~ $ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
~ $ which ruby
/Users/moxley/.rubies/ruby-2.1.2/bin/ruby
Install bundler:gem install bundler
Install project gems:cd ~/projects/bands
bundle
Verify rspec:~/projects/bands git:master(0) $ which rspec
/Users/moxley/.gem/ruby/2.1.2/bin/rspec
Quit and restart AtomRun test tests for a given test file: Ctrl+T
—
Reply to this email directly or view it on GitHub.
from atom-ruby-test.
Yeah, zshell isn't supported yet.
from atom-ruby-test.
Everybody who is interested in this feature, can you please test #22 and provide feedback on the PR?
from atom-ruby-test.
This should work in version 0.9.0. Feel free to post comments on this issue if it doesn't.
from atom-ruby-test.
Sorry for no comments on this while you were trying to fix it--had project deadlines so I switched back to RubyMine so I could be productive again. :)
I'm still seeing issues here, running 0.9.1. I set the Shell option to /bin/zsh
, reverted all settings back to default, restarted Atom, go to run a specific test and am seeing:
Running tests: rspec --tty /spec/controllers/things_controller_spec.rb:104
---
zsh:1 command not found: rspec
Amongst other things, I have this in my .zshrc:
# chruby
source /usr/local/opt/chruby/share/chruby/chruby.sh
chruby 2.1.2
I then realized that I'm using bundler to install gems to vendor/bundle
, so I just gem install
ed rspec, restarted Atom, and am still getting the same error as posted above.
Next, I tried changing default settings to use bin/rspec
instead of rspec
, and that fails with the same error that I reported initially (sure would be nice to be able to copy text from the console, atom... grr). That makes it seem like it's still not loading my .zshrc.
So next, I prefaced the commands with source ~/.zshrc
and that got me using the right ruby, but got cannot load such file -- [the wrong path to my spec file] (LoadError)
. The path for the spec that it was looking for was /Users/sloveless/Development/spec/controllers/things_controller_spec.rb
, when it really should have been /Users/sloveless/Development/projects/my_project/spec/controllers/things_controller_spec.rb
. I then noticed that there's an Atom "Project Home" setting, which was set to /Users/sloveless/Development
, so I changed that to /Users/sloveless/Development/projects/my_project
, reran the test and got the same error (with the wrong path). I then restarted Atom, just in case, ran again, and it's still looking in the wrong directory.
Next, I tried not sourcing my .zshrc (just in case that was doing some PATH) stuff, and changed my commands to look like:
source /usr/local/opt/chruby/share/chruby/chruby.sh && chruby 2.1.2 && rspec --tty {relative_path}
New error from bundler: "You have already activated rspec-support 3.1.0, but your Gemfile requires rspec-support 3.0.4 [etc...]". So now I'm working out of the correct path for my project, but the commands aren't using bundler.
I got it working using commands like:
source /usr/local/opt/chruby/share/chruby/chruby.sh && chruby 2.1.2 && bin/rspec --tty {relative_path}
Using bin/rspec
instead of just rspec
seems like something reasonable for me to have to do (instead of being this plugin's default), but it'd be nice to not have to do the chruby stuff.
Suggestions:
- Give an option for a "run before tests shell script" or something. That way, I could just write a small shell script to do things for me--or just source the
chruby.sh
like I'm doing--to get around problems I'm having. Not sure if this is opening the door for bad hackery though. - It doesn't seem like the plugin is picking up on the
.ruby-version
file in my project's root dir, which would be nice.
from atom-ruby-test.
Hey,
I also just stumbled upon this, and have the same issues. That's why I'd love to see this issue reopened. A little thing I found is that calling chruby_auto
right before the test at least helps picking up the .ruby-version
file so my commands look like chruby_auto && ruby -I test {relative_path}
Maybe something like a shell setup block or such would help :)
from atom-ruby-test.
@NesQuick When I prefix my command with chruby_auto
the results window says the command is not found. How are you getting Atom and/or ruby-test to load chruby in the first place?
from atom-ruby-test.
source ~/.zshrc && chruby_auto && bin/rspec --tty spec
This works, but initializing my shell every time is quite time consuming. I'd imagine I could probably load chruby this way and exclude most of the irrelevant ZSH pieces, but this still incurs a big startup cost. I wonder if there's a way to initialize this into the Atom environment itself.
from atom-ruby-test.
@yock I created the .zprofile
file as mentioned in a similar issue #60
λ ~ cat ~/.zprofile
source ~/.zshrc
from atom-ruby-test.
Related Issues (20)
- Overwrites spec files white space if using Whitespace package HOT 1
- Atom 1.17 Docks support HOT 2
- Looking for maintainer HOT 4
- Toggle to the test panel to activate the package: cmd-ctrl-x does not work HOT 2
- Changes required due to TextBuffer.save becoming async in Atom 1.19 HOT 2
- Spring problem, terminal is reopening on each run
- Testing just opens a shell, but doesnt run the tests. HOT 1
- Not have option to zoom/alter the font, is very small. HOT 1
- Uncaught TypeError: Cannot read property 'nodeName' of undefined
- how to test gem
- platformio-ide-terminal no longer supported - how do I reconfigure to use terminus? HOT 3
- not working for win 7 HOT 1
- Closing the test pane leaves a blank bar HOT 2
- Using Atom 1.8.0, the Settings-->Packages widget cant find "Ruby Test" HOT 1
- Spec framework incorrectly identified as minitest when using require_relative spec_helper HOT 1
- Run tests for current code file HOT 2
- Suggestion: Command Prefix HOT 2
- Cancelling doesn't actually cancel. HOT 1
- Update Documentation for running single file test HOT 1
- Focus issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atom-ruby-test.