autotest/rails [...] doesn't [...] exist. Aborting
Downgraded ZenTest from 4.1.4 to 4.1.3 and autotest works again.
ZenTest autotest not running tests
I had a similar problem which I resolved by downgrading to 4.0.0. Unfortunately I didn't have time to investigate why this happened in the first place, but I would be interested to know.
autotest problem
I don't know japanese, but looking at
http://d.hatena.ne.jp/hkj/20110724
I learned that you can make it work by changing line 226 from:
# hacky_discovery = Gem::Specification.any? { |s| s.name =~ /^rspec/ }
to
# hacky_discovery = true
This line was last modified in this commit: https://github.com/seattlerb/zentest/commit/b462a8f1dcc03528d91c77cabc15f8575d9c378c
This issue is reported here: https://github.com/seattlerb/zentest/issues/5
UPDATE: To solve this problem just upgrade your rubygems: gem update --system
UPDATE 2: ZenTest 4.6.1 solves this problem.
autospec with multiple versions of Ruby
I would guess it is a ZenTest incompatibility with Ruby 1.9.
It looks from isitruby19.com that you aren't the only one having trouble with it. Fewer people are having trouble with rspec (and their issues are failing tests, not inability to run), so I'd be inclined to say it's ZenTest.
Personally, I'm just staying away from 1.9 because I have too many commercial development projects on the go. Hopefully I'll be able to help more with something like Rails 3 releases.
`heroku open` fails - table doesn't exist error in logs
It took a while to get this working, but I finally did - to solve this particular piece of the puzzle, I added /lib
and /spec
to .slugignore
- that's probably not the answer for everyone, but for the moment it's fine for me.
rake spec' doesn't run with custom RAILS_ENV but 'rspec' and 'bundle exec rspec' do
Several points:
rspec
rspec
and bundle exec rspec
always run your tests because it uses directly the rspec
executable.
rake
The gem rspec-rails
defines some rake tasks, including the spec
task. However, rake
will only be able to run this task if the rspec gem has been loaded in the used environment. If you have something like this in your Gemfile:
group :test, :development do
gem 'rspec-rails', '~> 3.0'
end
The spec
task command will only work in the test and development environment, and not with RAILS_ENV=ci
.
bundle
It is recommended to always use bundle exec
to run a ruby executable. From the Bundler website:
In some cases, running executables without
bundle exec
may work, if
the executable happens to be installed in your system and does not
pull in any gems that conflict with your bundle.However, this is unreliable and is the source of considerable pain.
Even if it looks like it works, it may not work in the future or on
another machine.
Without bundle exec
, the executable may have unexpected or inconsistent behavior, by mixing other gems or gem versions already installed on your machine.
In your case, the fact that RAILS_ENV=ci rake
works and RAILS_ENV=ci rake spec
doesn't could be caused by some conflict with an older version of rspec-spec
, or by some other gem defining other default rake task.
In any case, this behavior is nor a bug and is probably specific to your machine. I'd recommend using exclusively bundle exec rspec
to run your tests.
EDIT: In response to your remarks:
4 - The fact that rake spec
doesn't crash even if rspec-rails
is not loaded is a tricky part. When you try to run a task example
, rake
first searches for the task example
in the loaded rakefiles. If it doesn't find it, it will check if the file example
exists in your project. If it does, it will try to execute so task from this file.
In your case, the file spec
exists in your project, and is a directory. So when you do rake spec
, if the task spec
doesn't exists, it will load your spec
file, and do nothing before there is no task to run in it.
That's why rake blublu
will fail, but rake spec
or rake app
won't.
Related Topics
After Installing a Gem Within a Script, How to Load the Gem
Ruby Escape Argv Argument or String as Argument to Shell Command
How to Create Temp Dir in Ruby
Dynamically Create Class Attributes with Attr_Accessor
Use Separate Authentication Model with Devise on Rails
Ruby, Tor and Net::Http::Proxy
How to Create a Form in Rails Without Having to Use Form_For and a Model Instance
Rails Nested With_Option :If Used in Validation
Bundle Command Not Found Windows X64
How to Run and Debug Ruby on Rails from Visual Studio Code
Ruby Sandboxing VS. Integrating a Scripting Language
Connect to Tor Network with Ruby
Implementing Bayesian Classifier in Ruby
How to Remove All Elements That Satisfy a Condition in Array in Ruby
Does Multibyte Character Interfere with End-Line Character Within a Regex