small medium large xlarge

Generic-user-small
20 Jul 2017, 14:18
John Yeates (8 posts)

I’ve just added the test on p162. When I run rails test, EVERY test fails with either

ActionView::Template::Error: couldn't find file 'jquery-ui' with type 'text/css' or ActionView::Template::Error: couldn't find file 'jquery' with type 'application/javascript'.

The site still works fine in the browser, but now all the tests are broken.

I’m running Rails 5.1.2.

What could be going wrong here? The includes I’m using in the various manifests are:

app/assets/javascripts/application.js:

//= require rails-ujs  
//= require turbolinks  
//= require jquery  
//= require jquery-ui  
//= require_tree .

app/assets/stylesheets/application.scss:

 *= require jquery-ui  
 *= require_tree .  
 *= require_self

(Incidentally, the Markdown help is wrong — it says to use three ~ characters to delineate a code block, but it’s actually three ` characters. And it doesn’t render newlines in code blocks, making it pretty pointless :)

Dmfcb_pragsmall
20 Jul 2017, 13:32
David Copeland (467 posts)

What’s in your Gemfile? The book might be missing the instructions to add the gem that provides jQuery UI. Also, the upcoming beta removes the requirements for jQuery entirely, but it won’t be out for a few days.

Side note, the markdown-esque stuff seems to work with tildes for me in the past:

app/assets/javascripts/application.js:

//= require rails-ujs
//= require turbolinks
//= require jquery
//= require jquery-ui
//= require_tree .
Generic-user-small
20 Jul 2017, 13:55
John Yeates (8 posts)

My Gemfile is

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end
gem 'rails', '~> 5.1.2'
gem 'sqlite3'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
# gem 'therubyracer', platforms: :ruby
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
# gem 'redis', '~> 3.0'
# gem 'bcrypt', '~> 3.1.7'
gem 'rails-i18n'
gem 'jquery-rails'
gem 'jquery-ui-rails'
# gem 'capistrano-rails', group: :development

group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end

group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

That said, if the next beta is going to lose jQuery, I’m not quite so worried about it :)

Thanks!

(ah — you need a blank line before the opening three ~ characters…)

You must be logged in to comment