When I run my tests, the controller one fails claiming that it can't find any views/categories/new.html.erb file. This is the failure:
$ rake test:controllers
DL is deprecated, please use Fiddle
Run options: --seed 30439
# Running:
E
Finished in 2.486100s, 0.4022 runs/s, 0.0000 assertions/s.
1) Error:
CategoriesControllerTest#test_new:
ActionView::Template::Error: No such file or directory @ unlink_internal - C:/Users/Javi/AppData/Local/Temp/execjs201504
29-7768-ntpk2ujson
app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__379261802_30194400'
test/controllers/categories_controller_test.rb:6:in `test_new'
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
This is my full test stacktrace. I think maybe its a problem with the execjs or something having to do with how my javascript is loading on my application. This app is almost basic toy app with nothing on it that I just started.
$ BACKTRACE=1 rake test:controllers
DL is deprecated, please use Fiddle
Run options: --seed 11579
# Running:
E
Finished in 2.514007s, 0.3978 runs/s, 0.0000 assertions/s.
1) Error:
CategoriesControllerTest#test_new:
ActionView::Template::Error: No such file or directory @ unlink_internal - C:/Users/Javi/AppData/Local/Temp/execjs201504
29-6372-sgswcqjson
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:173:in `unlink'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:173:in `ensure in e
xec_runtime'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:173:in `exec_runtim
e'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:39:in `exec'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:14:in `initialize'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/runtime.rb:44:in `new'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/runtime.rb:44:in `compile'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/module.rb:27:in `compile'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:50:in `context'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:78:in `compile'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/coffee_script_processor.rb:21:in
`block in call'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/cache.rb:85:in `fetch'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/coffee_script_processor.rb:20:in
`call'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/processor_utils.rb:75:in `call_pr
ocessor'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/processor_utils.rb:57:in `block i
n call_processors'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/processor_utils.rb:56:in `reverse
_each'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/processor_utils.rb:56:in `call_pr
ocessors'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/loader.rb:87:in `load_asset_by_ur
i'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/loader.rb:45:in `block in load'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/loader.rb:157:in `fetch_asset_fro
m_dependency_cache'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/loader.rb:38:in `load'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/cached_environment.rb:20:in `bloc
k in initialize'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/cached_environment.rb:47:in `yiel
d'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/cached_environment.rb:47:in `load
'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/bundle.rb:23:in `block in call'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/utils.rb:183:in `dfs'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/bundle.rb:24:in `call'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/processor_utils.rb:75:in `call_pr
ocessor'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/processor_utils.rb:57:in `block i
n call_processors'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/processor_utils.rb:56:in `reverse
_each'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/processor_utils.rb:56:in `call_pr
ocessors'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/loader.rb:87:in `load_asset_by_ur
i'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/loader.rb:45:in `block in load'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/loader.rb:157:in `fetch_asset_fro
m_dependency_cache'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/loader.rb:38:in `load'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/cached_environment.rb:20:in `bloc
k in initialize'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/cached_environment.rb:47:in `yiel
d'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/cached_environment.rb:47:in `load
'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/base.rb:63:in `find_asset'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-3.0.3/lib/sprockets/base.rb:89:in `[]'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:123:in `ass
et_digest_path'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:76:in `comp
ute_asset_path'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/helpers/asset_url_helper.rb:13
5:in `asset_path'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:91:in `asse
t_path'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/helpers/asset_url_helper.rb:24
5:in `javascript_path'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/helpers/asset_tag_helper.rb:61
:in `block in javascript_include_tag'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/helpers/asset_tag_helper.rb:59
:in `map'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/helpers/asset_tag_helper.rb:59
:in `javascript_include_tag'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:148:in `jav
ascript_include_tag'
c:/Users/Javi/desktop/rails_projects/minitest_app/app/views/layouts/application.html.erb:6:in `_app_views_layouts_ap
plication_html_erb__741928323_31430316'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/template.rb:145:in `block in r
ender'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:164:in
`block in instrument'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications/instrument
er.rb:20:in `instrument'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:164:in
`instrument'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/template.rb:333:in `instrument
'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/template.rb:143:in `render'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/renderer/template_renderer.rb:
66:in `render_with_layout'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/renderer/template_renderer.rb:
52:in `render_template'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/renderer/template_renderer.rb:
14:in `render'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/renderer/renderer.rb:42:in `re
nder_template'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/renderer/renderer.rb:23:in `re
nder'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/rendering.rb:100:in `_render_t
emplate'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/streaming.rb:217:i
n `_render_template'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/rendering.rb:83:in `render_to_
body'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/rendering.rb:32:in
`render_to_body'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/renderers.rb:37:in
`render_to_body'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/abstract_controller/rendering.rb:25:in `re
nder'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/rendering.rb:16:in
`render'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/instrumentation.rb
:44:in `block (2 levels) in render'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/core_ext/benchmark.rb:12
:in `block in ms'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/core_ext/benchmark.rb:12
:in `ms'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/instrumentation.rb
:44:in `block in render'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/instrumentation.rb
:87:in `cleanup_view_runtime'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/railties/controller_runtim
e.rb:25:in `cleanup_view_runtime'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/instrumentation.rb
:43:in `render'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/implicit_render.rb
:10:in `default_render'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/implicit_render.rb
:5:in `send_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/abstract_controller/base.rb:198:in `proces
s_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/rendering.rb:10:in
`process_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/abstract_controller/callbacks.rb:20:in `bl
ock in process_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:117:in `cal
l'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:117:in `cal
l'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:555:in `blo
ck (2 levels) in compile'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:505:in `cal
l'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:505:in `cal
l'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:92:in `_run
_callbacks'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:776:in `_ru
n_process_action_callbacks'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:81:in `run_
callbacks'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/abstract_controller/callbacks.rb:19:in `pr
ocess_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/rescue.rb:29:in `p
rocess_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/instrumentation.rb
:32:in `block in process_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:164:in
`block in instrument'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications/instrument
er.rb:20:in `instrument'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:164:in
`instrument'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/instrumentation.rb
:30:in `process_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/metal/params_wrapper.rb:
250:in `process_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/railties/controller_runtim
e.rb:18:in `process_action'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/abstract_controller/base.rb:137:in `proces
s'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.1/lib/action_view/rendering.rb:30:in `process'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/test_case.rb:632:in `pro
cess'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/test_case.rb:65:in `proc
ess'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/action_controller/test_case.rb:508:in `get
'
c:/Users/Javi/desktop/rails_projects/minitest_app/test/controllers/categories_controller_test.rb:6:in `test_new'
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
As you can see on this line:
ActionView::Template::Error: No such file or directory @ unlink_internal - C:/Users/Javi/AppData/Local/Temp/execjs201504
29-7216-9o5jujjson
Is a bit weird, I am not sure what it means. I went to the C:/Users/Javi directory and was unable to find any AppData folder... Not sure why that is even a thing at it's not on my system.
This is my gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.7.1'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem "minitest-rails"
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
This is my application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>MinitestApp</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
The error message says that the error occurs at line 6:
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
So this leads me to believe my javascript is not loading properly...
I am using Minitest, here is my controller test:
require "test_helper"
class CategoriesControllerTest < ActionController::TestCase
def test_new
get :new
assert_response :success
end
end
I have also created a new.html.erb view that is mostly blank except for some dummy text:
This is my new file! #This is inside my views/categories/new.html.erb
Here is my controller:
class CategoriesController < ApplicationController
def new
end
end
When I turn on rails server and I navigate to my root/categories/new route I get the following error message:
Errno::ENOENT in Categories#new
Showing c:/Users/Javi/desktop/rails_projects/testing_basics/app/views/layouts/application.html.erb where line #6 raised:
No such file or directory @ unlink_internal - C:/Users/Javi/AppData/Local/Temp/execjs20150429-4112-xc20tpjson
Rails.root: c:/Users/Javi/desktop/rails_projects/testing_basics
Can someone please help me figure this out? I have been stuck on this for 2 full days. I have tried downgrading execjs gem version but still get the error. I have also restarted from scratch and get the same error at the same place. Not sure what else to do now...