Agile Web Development with Rails, Edition 5

Table of Contents 26.3 Pagination

26.4 Devise

edit Gemfile
gem 'devise', '~> 3.0.0.rc'
bundle install --local
Your Gemfile has no gem server sources. If you need gems that are not already on
your machine, add a line like this to your Gemfile:
source 'https://rubygems.org'
Could not find gem 'devise (~> 3.0.0.rc)' in any of the gem sources listed in
your Gemfile.

install devise

rails generate devise:install
/home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/resolver.rb:386:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'devise (~> 3.0.0.rc)' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/resolver.rb:356:in `each'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/resolver.rb:356:in `verify_gemfile_dependencies_are_found!'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/resolver.rb:203:in `start'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/resolver.rb:182:in `resolve'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/definition.rb:252:in `resolve'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/definition.rb:176:in `specs'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/definition.rb:235:in `specs_for'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/definition.rb:224:in `requested_specs'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:118:in `block in definition_method'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:19:in `setup'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler.rb:100:in `setup'
	from /home/rubys/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/setup.rb:20:in `<top (required)>'
	from /home/rubys/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /home/rubys/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
edit Gemfile
gem 'kaminari', '~> 1.0'
gem 'activemerchant', '~> 1.58'
# gem 'devise', '~> 3.0.0.rc'
gem 'erubis'
gem 'haml', '~> 4.0'

cleanup - precompile assets for inclusion in results

rails assets:precompile
DEPRECATION WARNING: ActionView::Template::Handlers::Erubis is deprecated and will be removed from Rails 5.2. Switch to ActionView::Template::Handlers::ERB::Erubi instead. (called from require at /home/rubys/.rvm/gems/ruby-2.4.0/gems/haml-4.0.7/lib/haml/helpers/safe_erubis_template.rb:3)
Yarn executable was not detected in the system.
Download Yarn at https://yarnpkg.com/en/docs/install
I, [2017-03-20T00:46:10.011331 #26654]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work-240/depot/public/assets/manifest-e761884522a9ca2dac475b68bac1946c990fb9af8b676d3b6b45692a920c8d04.js
I, [2017-03-20T00:46:10.011542 #26654]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work-240/depot/public/assets/manifest-e761884522a9ca2dac475b68bac1946c990fb9af8b676d3b6b45692a920c8d04.js.gz
I, [2017-03-20T00:46:10.012002 #26654]  INFO -- : Writing /home/rubys/git/awdwr/edition4/work-240/depot/public/assets/7apps-f67c3d908f537bac34a290206cc1db4c6f4611196c550e49ba836b796a2602bb.jpg
rails aborted!
NoMethodError: undefined method `split' for nil:NilClass
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/http_utils.rb:17:in `match_mime_type?'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:297:in `block in exporters_for_asset'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:296:in `each'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:296:in `exporters_for_asset'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:183:in `block in compile'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/base.rb:81:in `find_all_linked_assets'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:124:in `block in find'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:123:in `each'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:123:in `find'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/sprockets/manifest.rb:165:in `compile'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-4.0.0.beta4/lib/rake/sprocketstask.rb:148:in `with_logger'
/home/rubys/.rvm/gems/ruby-2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/home/rubys/git/rails/railties/lib/rails/commands/rake/rake_command.rb:21:in `block in perform'
/home/rubys/git/rails/railties/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/home/rubys/git/rails/railties/lib/rails/command.rb:46:in `invoke'
/home/rubys/git/rails/railties/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

Table of Contents 26.3 Pagination