Agile Web Development with Rails, Edition 5

Table of Contents 25.3 CSS with Webpack

27.4 Devise

edit Gemfile
#<IndexError: regexp not matched>
  /home/rubys/git/gorp/lib/gorp/edit.rb:150:in `[]='
  /home/rubys/git/gorp/lib/gorp/edit.rb:150:in `msub'
  makedepot.rb:5431:in `block (2 levels) in <main>'
  /home/rubys/git/gorp/lib/gorp/edit.rb:173:in `instance_exec'
  /home/rubys/git/gorp/lib/gorp/edit.rb:173:in `edit'
  makedepot.rb:5430:in `block in <main>'
  /home/rubys/git/gorp/lib/gorp/output.rb:59:in `block (4 levels) in <top (required)>'
  /home/rubys/git/gorp/lib/gorp/output.rb:49:in `each'
  /home/rubys/git/gorp/lib/gorp/output.rb:49:in `block (3 levels) in <top (required)>'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:175:in `_nested_structures'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:68:in `tag!'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:93:in `method_missing'
  /home/rubys/git/gorp/lib/gorp/output.rb:22:in `block (2 levels) in <top (required)>'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:175:in `_nested_structures'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:68:in `tag!'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:93:in `method_missing'
  /home/rubys/git/gorp/lib/gorp/output.rb:11:in `block in <top (required)>'
    
# source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
 
ruby '2.4.1'
 
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "queue_classic", :path => "/home/rubys/git/queue_classic"
gem "resque-scheduler", :path => "/home/rubys/git/resque-scheduler"
gem "rb-inotify", :path => "/home/rubys/git/rb-inotify"
gem "arel", :path => "/home/rubys/git/arel"
gem 'rails', :path => "/home/rubys/git/rails" # '~> 5.2.0.alpha'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
group :production do
  gem 'mysql2', '~> 0.4.0'
end
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', :path => "/home/rubys/git/sass-rails" # '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
 
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster.
# Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
 
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
 
# Use Capistrano for deployment
gem 'capistrano-rails', group: :development
gem 'capistrano-rvm', group: :development
gem 'capistrano-bundler', group: :development
gem 'capistrano-passenger', group: :development
 
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
 
 
group :development, :test do
  gem 'rspec-rails'      
    
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of chromedriver to run system tests with Chrome
  gem 'chromedriver-helper'
end
 
group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', :path => "/home/rubys/git/web-console" # '>= 3.3.0'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end
 
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
 
gem 'activemodel-serializers-xml'
 
gem 'slim-rails'
gem 'webpacker', '~> 3.0'# START: i18n-js
 
gem 'i18n-js'
# END: i18n-js
bundle install --local
Using rake 12.2.1
Using concurrent-ruby 1.0.5
Using i18n 0.9.1
Using minitest 5.10.3
Using thread_safe 0.3.6
Using tzinfo 1.2.4
Using activesupport 5.2.0.alpha from source at `/home/rubys/git/rails`
Using builder 3.2.3
Using erubi 1.7.0
Using mini_portile2 2.3.0
Using nokogiri 1.8.1
Using rails-dom-testing 2.0.3
Using crass 1.0.2
Using loofah 2.1.1
Using rails-html-sanitizer 1.0.3
Using actionview 5.2.0.alpha from source at `/home/rubys/git/rails`
Using rack 2.0.3
Using rack-test 0.7.0
Using actionpack 5.2.0.alpha from source at `/home/rubys/git/rails`
Using nio4r 2.1.0
Using websocket-extensions 0.1.3
Using websocket-driver 0.6.5
Using actioncable 5.2.0.alpha from source at `/home/rubys/git/rails`
Using globalid 0.4.1
Using activejob 5.2.0.alpha from source at `/home/rubys/git/rails`
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 5.2.0.alpha from source at `/home/rubys/git/rails`
Using activemodel 5.2.0.alpha from source at `/home/rubys/git/rails`
Using activemodel-serializers-xml 1.0.2
Using arel 9.0.0.alpha from source at `/home/rubys/git/arel`
Using activerecord 5.2.0.alpha from source at `/home/rubys/git/rails`
Using activestorage 5.2.0.alpha from source at `/home/rubys/git/rails`
Using public_suffix 3.0.1
Using addressable 2.5.2
Using net-ssh 4.2.0
Using net-scp 1.2.1
Using sshkit 1.15.0
Using airbrussh 1.3.0
Using io-like 0.3.0
Using archive-zip 0.7.0
Using bcrypt 3.1.11
Using bindex 0.5.0
Using msgpack 1.1.0
Using bootsnap 1.1.5
Using bundler 1.16.0
Using byebug 9.1.0
Using capistrano 3.10.0
Using capistrano-bundler 1.3.0
Using capistrano-passenger 0.2.0
Using capistrano-rails 1.3.0
Using capistrano-rvm 0.1.2
Using xpath 2.1.0
Using capybara 2.15.4
Using ffi 1.9.18
Using childprocess 0.8.0
Using chromedriver-helper 1.1.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using method_source 0.9.0
Using thor 0.19.4
Using railties 5.2.0.alpha from source at `/home/rubys/git/rails`
Using coffee-rails 4.2.2
Using diff-lcs 1.3
Using et-orbi 1.0.8
Using i18n-js 3.0.2
Using multi_json 1.12.2
Using jbuilder 2.7.0
Using mono_logger 1.1.0
Using mustermann 1.0.1
Using mysql2 0.4.9
Using pg 0.19.0
Using puma 3.10.0
Using queue_classic 3.2.0.RC1 from source at `/home/rubys/git/queue_classic`
Using rack-protection 2.0.0
Using rack-proxy 0.6.2
Using sprockets 3.7.1
Using sprockets-rails 3.2.1
Using rails 5.2.0.alpha from source at `/home/rubys/git/rails`
Using rb-fsevent 0.10.2
Using rb-inotify 0.9.9 from source at `/home/rubys/git/rb-inotify`
Using redis 4.0.1
Using redis-namespace 1.6.0
Using tilt 2.0.8
Using sinatra 2.0.0
Using vegas 0.1.11
Using resque 1.27.4
Using rufus-scheduler 3.4.2
Using resque-scheduler 4.3.0 from source at `/home/rubys/git/resque-scheduler`
Using rspec-support 3.7.0
Using rspec-core 3.7.0
Using rspec-expectations 3.7.0
Using rspec-mocks 3.7.0
Using rspec-rails 3.7.1
Using rubyzip 1.2.1
Using sass-listen 4.0.0
Using sass 3.5.3
Using sass-rails 5.0.6 from source at `/home/rubys/git/sass-rails`
Using selenium-webdriver 3.7.0
Using temple 0.8.0
Using slim 3.0.9
Using slim-rails 3.1.3
Using spring 2.0.2
Using sqlite3 1.3.13
Using turbolinks-source 5.0.3
Using turbolinks 5.0.1
Using uglifier 3.2.0
Using web-console 3.5.1 from source at `/home/rubys/git/web-console`
Using webpacker 3.0.2
Bundle complete! 31 Gemfile dependencies, 110 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

install devise

rails generate devise:install
Could not find generator 'devise:install'. Maybe you meant 'rspec:install', 'assets' or 'generator'
Run `rails generate --help` for more options.
edit Gemfile
#<IndexError: regexp not matched>
  /home/rubys/git/gorp/lib/gorp/edit.rb:150:in `[]='
  /home/rubys/git/gorp/lib/gorp/edit.rb:150:in `msub'
  makedepot.rb:5442:in `block (2 levels) in <main>'
  /home/rubys/git/gorp/lib/gorp/edit.rb:173:in `instance_exec'
  /home/rubys/git/gorp/lib/gorp/edit.rb:173:in `edit'
  makedepot.rb:5441:in `block in <main>'
  /home/rubys/git/gorp/lib/gorp/output.rb:59:in `block (4 levels) in <top (required)>'
  /home/rubys/git/gorp/lib/gorp/output.rb:49:in `each'
  /home/rubys/git/gorp/lib/gorp/output.rb:49:in `block (3 levels) in <top (required)>'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:175:in `_nested_structures'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:68:in `tag!'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:93:in `method_missing'
  /home/rubys/git/gorp/lib/gorp/output.rb:22:in `block (2 levels) in <top (required)>'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:175:in `_nested_structures'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:68:in `tag!'
  /home/rubys/.rvm/gems/ruby-2.4.1/gems/builder-3.2.3/lib/builder/xmlbase.rb:93:in `method_missing'
  /home/rubys/git/gorp/lib/gorp/output.rb:11:in `block in <top (required)>'
    
# source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
 
ruby '2.4.1'
 
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "queue_classic", :path => "/home/rubys/git/queue_classic"
gem "resque-scheduler", :path => "/home/rubys/git/resque-scheduler"
gem "rb-inotify", :path => "/home/rubys/git/rb-inotify"
gem "arel", :path => "/home/rubys/git/arel"
gem 'rails', :path => "/home/rubys/git/rails" # '~> 5.2.0.alpha'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
group :production do
  gem 'mysql2', '~> 0.4.0'
end
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', :path => "/home/rubys/git/sass-rails" # '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
 
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster.
# Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
 
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
 
# Use Capistrano for deployment
gem 'capistrano-rails', group: :development
gem 'capistrano-rvm', group: :development
gem 'capistrano-bundler', group: :development
gem 'capistrano-passenger', group: :development
 
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
 
 
group :development, :test do
  gem 'rspec-rails'      
    
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of chromedriver to run system tests with Chrome
  gem 'chromedriver-helper'
end
 
group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', :path => "/home/rubys/git/web-console" # '>= 3.3.0'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end
 
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
 
gem 'activemodel-serializers-xml'
 
gem 'slim-rails'
gem 'webpacker', '~> 3.0'# START: i18n-js
 
gem 'i18n-js'
# END: i18n-js

cleanup - precompile assets for inclusion in results

rails assets:precompile
yarn install v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@rails/webpacker > postcss-cssnext@3.0.2" has unmet peer dependency "caniuse-lite@^1.0.30000697".
warning " > webpack-dev-server@2.9.4" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
warning "webpack-dev-server > webpack-dev-middleware@1.12.0" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
[4/4] Building fresh packages...
Done in 2.90s.
I, [2017-11-13T10:49:19.537307 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/7apps-f67c3d908f537bac34a290206cc1db4c6f4611196c550e49ba836b796a2602bb.jpg
I, [2017-11-13T10:49:19.538152 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/adrpo-23a974519e0d4353c6906f82b40bd4cd98b09a2ce748825370c7aa59763f5ac7.jpg
I, [2017-11-13T10:49:19.539137 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/dcbang-ad9b1d51642858e55eef18318f2aa44d3dab14670e8441658a4efef032ce0dc9.jpg
I, [2017-11-13T10:49:19.539833 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/logo-a8906fb6c933f00883d2ad0385ae52201c0e1d1f9235c37f4a5762f02ad80936.svg
I, [2017-11-13T10:49:19.540002 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/logo-a8906fb6c933f00883d2ad0385ae52201c0e1d1f9235c37f4a5762f02ad80936.svg.gz
I, [2017-11-13T10:49:19.540743 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/lorem-f67c3d908f537bac34a290206cc1db4c6f4611196c550e49ba836b796a2602bb.jpg
I, [2017-11-13T10:49:19.541585 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/rails-5ad6d454af23f597c4c39dbe4ec6e12784f8e382997a4bc04944ab8547d48881.png
I, [2017-11-13T10:49:19.542305 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/ruby-c18fb0e1485e83ca7a1a36fe3ae08364cf9593fba7c5fd7c64e444760e2d4e55.jpg
I, [2017-11-13T10:49:19.549352 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/application-0b279bf4b798afc1d006fb96ef9ca91ab07fbfa82fea9aa545c76ed48a4e1837.js
I, [2017-11-13T10:49:19.549505 #11732]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work/depot/public/assets/application-0b279bf4b798afc1d006fb96ef9ca91ab07fbfa82fea9aa545c76ed48a4e1837.js.gz
Webpacker is installed 🎉 🍰
Using /home/rubys/git/awdwr/edition4/work/depot/config/webpacker.yml file for setting up webpack paths

Table of Contents 25.3 CSS with Webpack