Im developing in c9.io in a rails server. I execute
rails test and it works corectly. Next day I execute the same command but instead appear Error: Command 'test' not recognized I do not change anything. How can I restore this command?
Note:rake test works perfectly but ruby page http://edgeguides.rubyonrails.org/testing.html and ruby on rails tutorial by Michael Hartl https://www.railstutorial.org/book/static_pages talk about rails test command and it work for me 2 days.
this is my gemfile
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'sass-rails', '5.0.2'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
Answered by MarsAtomic:
Prior to Rails 5, you had to run tests using the rake tool. With Rails 5, you run tests with rails test. Either you a) downgraded your Rails version, or b) you were testing against an entirely different project using Rails 5, or c) you were simply mistaken and were using rake test the entire time.
Since you say you have not changed anything:
Step 1
Make sure you are in your project's directory:
cd /path/to/app
Step 2
Make sure you are using the version of Rails you think you are using:
rails -v
Step 3
Compare that against your application's environment:
If your app is Rails 4, this will return information about your app:
rake about
If your app is Rails 5, that will not work, but this will:
rails about
Step 4
Use the appropriate command for the Rails version of your app.
If your app is Rails 4:
rake test
If your app is Rails 5:
rails test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With