RubyTest in Sublime Text 2
To get this to work you only need to change one setting in the RubyTest package in sb2.
If you are using rvm, your rspec gem is installed through rvm and is not found in /bin/sh
So you need to set the RubyTest package for Sublime Text 2 to automatically check for your rvm environment variables.
What to change:
1) In Sublime Text 2, go to Preferences|Browse Packages. This will open up your packages directory.
2) Open the 'RubyTest' directory and look for the file 'RubyTest.sublime-settings'.
3) find the line that says:
"check_for_rvm": false,
and change it to:
"check_for_rvm": true,
save the change.
4) That's it. It should now work.
Good Luck
RubyTest with SublimeText 2
How are you starting the sublime?
Following url should help you in starting sublime from terminal, which should fix this problem
http://www.sublimetext.com/docs/2/osx_command_line.html
Sublime Text 2 - RubyTest with ruby 2.0 not working
The error seems pretty explanatory:
You have already activated rspec-core 2.13.0, but your Gemfile requires rspec-core 2.11.1. Using bundle exec may solve this. (Gem::LoadError)
Either adjust the version of your rspec-rails (containing rspec-core) or run with bundle exec.
Solution:
Within your gemfile, change:
gem 'rspec-rails', '2.11.0'
To:
gem 'rspec rails', '2.13.0'
Sublime Test 2 RubyTest not showing any results
I think I might have the right solution for you, as I've just run into the same problem and solved it.
First, find out what's causing the "Building..."
error with RubyTest by digging into the Sublime Text 2 console (View > Show Console
).
This was my console output:
Running rspec spec/requests/static_pages_spec.rb -l15
Traceback (most recent call last):
File "./sublime_plugin.py", line 337, in run_
File "./exec.py", line 154, in run
File "./exec.py", line 45, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 72: ordinal not in range(128)
reloading /Users/Jonathan/Library/Application Support/Sublime Text 2/Packages/User/RubyTest.last-run
Taken from here, it turns out ST2 tries to evaluate all shell expressions.
From the same link, here's how I fixed it: go to Library > Application Support > Sublime Text 2 > Packages > Default
and edit exec.py
starting at the for
loop at line 45:
for k, v in proc_env.iteritems():
path_vars = os.path.expandvars(v)
if isinstance(path_vars, unicode):
path_vars = path_vars.encode(sys.getfilesystemencoding())
proc_env[k] = path_vars
Hope this solved your problem!
Rails: test code in lib directory with RubyTest with Sublime Text 2
The configuration file of RubyTest in Sublime Text 2 is here:
~/.config/sublime-text-2/Packages/RubyTest/RubyTest.sublime-settings
I added lib
to the -I
option in the ruby_unit_exec
like that:
"ruby_unit_exec": "ruby -Ilib:test"`
The problem is fixed.
Sublime Text 3, rbenv, TestUnit, RubyTest and Spring correct configuation to get tests working
This will do the trick
"run_ruby_unit_command": "export PATH=~/.rbenv/shims:$PATH; bin/rake test -Itest {relative_path}",
"run_single_ruby_unit_command": "export PATH=~/.rbenv/shims:$PATH; bin/rake test {relative_path} {test_name}",
Related Topics
Howto Rank Items by Balance in Ruby on Rails
An Algorithm for Converting a Base-10 Number to a Base-N Number
Cannot Login to Amazon with Ruby Mechanize
Replace "&" to "\&" in Ruby Seems Impossible
Create a Daemon with Double-Fork in Ruby
Sass/Compass Compile into Many Locations
Ruby Difference in Array Including Duplicates
How to Decode Rijndael in Ruby (Encoded in Vb.Net)
Getting Openssl::X509::Certificateerror Nested Asn1 Error on Ruby
Undefined Method 'Model_Name' for Project:Class
Why Does Ruby String#Split Not Treat Consecutive Trailing Delimiters as Separate Entities
What Does the Equal ('=') Symbol Do When Put After the Method Name in a Method Definition
How to Compile Ruby to Byte Code as with Python
How to Copy File Across Buckets Using Aws-S3 or Aws-Sdk Gem in Ruby on Rails
How to Pass Data from a Controller to a Model with Ruby on Rails