# Deploy with jekyll-paginate-v2 fails

**URL:** <https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320>\
**Category:** Uncategorized\
**Created:** [January 2, 2018, 5:53am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320 "2018-01-02T05:53:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 2, 2018, 5:53am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/1 "2018-01-02T05:53:08Z")

</div>

I just added pagination to my website, and everything works locally. In my local \_config.yml I have:

```
gems: [jekyll-paginate-v2]
pagination:
  enabled: true
  per_page: 3
  permalink: '/page/:num/'
  title_suffix: ' - page :num'
  limit: 0
  sort_field: 'date'
  sort_reverse: true

```

In my local and remote Gemfiles I have:

```
group :jekyll_plugins do
  gem "jekyll-paginate-v2"
end

```

I deploy on Digital Ocean using a script that automatically builds and moves files into my public www folder. When the script gets to `jekyll build --source $TMP_GIT_CLONE --destination $PUBLIC_WWW` I get an error:

`Dependency Error: Yikes! It looks like you don't have jekyll-paginate-v2 or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-paginate-v2'`

When I run `bundle update` remotely I get:

```
Using public_suffix 3.0.1
Using addressable 2.5.2
Using backports 3.11.0
Using bundler 1.16.1
Using colorator 1.1.0
Using diff-lcs 1.3
Using ffi 1.9.18
Using forwardable-extended 2.6.0
Using rb-fsevent 0.10.2
Using rb-inotify 0.9.10
Using sass-listen 4.0.0
Using sass 3.5.4
Using jekyll-sass-converter 1.5.1
Using ruby_dep 1.5.0
Using listen 3.1.5
Using jekyll-watch 1.5.1
Using kramdown 1.16.2
Using liquid 4.0.0
Using mercenary 0.3.6
Using pathutil 0.16.1
Using rouge 2.2.1
Using safe_yaml 1.0.4
Using jekyll 3.6.2
Using rack 1.6.8
Using rack-protection 1.5.3
Using tilt 2.0.8
Using sinatra 1.4.8
Using multi_json 1.12.2
Using rack-test 0.8.2
Using sinatra-contrib 1.4.7
Using jekyll-admin 0.7.0
Using jekyll-paginate-v2 1.9.0
Using mini_portile2 2.3.0
Using nokogiri 1.8.1
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 3.7.0

```

I’m not sure what else to do!

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [January 2, 2018, 5:22pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/2 "2018-01-02T17:22:32Z")

</div>

are you just doing `jekyll build` or `bundle exec jekyll build`? bundle exec is what installs the dependicies unless you are doing that some other way. At least that is my understanding - I am not using any plugins.

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 2, 2018, 5:45pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/3 "2018-01-02T17:45:45Z")

</div>

@rdyar I’m only doing `jekyll build`. I will try `bundle exec jekyll build`. Thanks!

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 2:53am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/4 "2018-01-03T02:53:42Z")

</div>

Unfortunately I have a new error:  
`remote: Could not locate Gemfile or .bundle/ directory`

Everything was working before I went down the path of installing jekyll-paginate-v2.

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 2:58am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/5 "2018-01-03T02:58:59Z")

</div>

Some more information:

When I try to run `bundle install` I get an error:  
`public_suffix-3.0.1 requires ruby version >= 2.1, which is incompatible with the current version, ruby 2.0.0p648`

I wonder if that’s related.

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 3:49am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/6 "2018-01-03T03:49:30Z")

</div>

Ok I updated Ruby and ran `bundle install` again. Everything is updated. No progress sadly.

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 4:10am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/7 "2018-01-03T04:10:54Z")

</div>

I just tried using jekyll-paginate and got the same result when I deployed:

`Dependency Error: Yikes! It looks like you don't have jekyll-paginate or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-paginate' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!`

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [January 3, 2018, 4:18am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/8 "2018-01-03T04:18:54Z")

</div>

bundler is supposed to install the dependencies from your gemfile. you could also just try manually installing them - `gem install jekyll-paginate-v2` maybe that would bypass whatever problem bundler is having with installing them or show you a different error.

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 4:26am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/9 "2018-01-03T04:26:09Z")

</div>

Oh I’m using this method to deploy:

> **[Deployment](https://jekyllrb.com/docs/deployment-methods/#git-post-receive-hook)**
>
> Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. Here’s some of the most common ways:

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 4:28am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/10 "2018-01-03T04:28:35Z")

</div>

Yup yup both versions of the plugin are installed.

```
gem install jekyll-paginate
Successfully installed jekyll-paginate-1.1.0
Parsing documentation for jekyll-paginate-1.1.0
Done installing documentation for jekyll-paginate after 0 seconds
1 gem installed

gem install jekyll-paginate-v2
Successfully installed jekyll-paginate-v2-1.9.0
Parsing documentation for jekyll-paginate-v2-1.9.0
Done installing documentation for jekyll-paginate-v2 after 1 seconds
1 gem installed
```

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [January 3, 2018, 5:02am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/11 "2018-01-03T05:02:03Z")

</div>

and now what is the error? same dependency error?

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [January 3, 2018, 6:41am UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/12 "2018-01-03T06:41:45Z")

</div>

Hi @diklein  
I had a look at the deployment method you’re using… and to me, it looks like Bundler isn’t reading the repo’s Gemfile as expected.

One can manually set the `BUNDLE_GEMFILE` ENV variable to the repo’s Gemfile. So your _updated_ `hooks/post-receive` will look like…:

```bash
GIT_REPO=$HOME/myrepo.git
TMP_GIT_CLONE=$HOME/tmp/myrepo
GEMFILE=$TMP_GIT_CLONE/Gemfile
PUBLIC_WWW=/var/www/myrepo

git clone $GIT_REPO $TMP_GIT_CLONE
BUNDLE_GEMFILE=$GEMFILE bundle install
BUNDLE_GEMFILE=$GEMFILE bundle exec jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit

```

Let me know if that works for you…

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 2:37pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/13 "2018-01-03T14:37:40Z")

</div>

Yes unfortunately. I suppose you see “1 gem installed” even if the gem is already installed?

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 2:44pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/14 "2018-01-03T14:44:30Z")

</div>

Thanks! Here’s what I get:

```
remote: Cloning into '/home/diklein/tmp/git/revamp'...
remote: done.
remote: Fetching gem metadata from https://rubygems.org/..........
remote: public_suffix-3.0.0 requires ruby version >= 2.1, which is incompatible with the
remote: current version, ruby 2.0.0p648
remote: /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find public_suffix-3.0.0 in any of the sources (Bundler::GemNotFound)
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `map!'
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `materialize'
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/definition.rb:170:in `specs'
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/definition.rb:237:in `specs_for'
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/definition.rb:226:in `requested_specs'
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/runtime.rb:108:in `block in definition_method'
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/runtime.rb:20:in `setup'
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler.rb:107:in `setup'
remote: from /home/diklein/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.16.1/lib/bundler/setup.rb:20:in `<top (required)>'
remote: from /home/diklein/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
remote: from /home/diklein/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'

```

Looks like my version or Ruby is old? But when I run `ruby -v` I get:

`ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]`

I updated Ruby last night. Do I need to reboot the server for the change to take place?

Thanks!

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 3:03pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/15 "2018-01-03T15:03:42Z")

</div>

Ok I restarted nginx and then ubuntu. Both times I see:

```
ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]

```

So that’s a problem! How does one actually update Ruby?

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 3:14pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/16 "2018-01-03T15:14:05Z")

</div>

I updated rvm and reinstalled Ruby. I see that I supposedly have ruby 2.4.1p111.

Same error when I try to deploy. public\_suffix requires ruby \>= 2.1.

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 3:16pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/17 "2018-01-03T15:16:39Z")

</div>

After I reboot unbuntu and run ruby -v:

`ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]`

Harrumph!

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 3:22pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/18 "2018-01-03T15:22:24Z")

</div>

A new state! There’s a lot of stuff here. I’m not sure where to begin. Fix `ffi`?

```
remote: Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
remote: Ignoring gem-wrappers-1.3.2 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.3.2
remote: Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Fetching gem metadata from https://rubygems.org/...........
remote: Fetching version metadata from https://rubygems.org/...
remote: Fetching dependency metadata from https://rubygems.org/..
remote: Installing public_suffix 3.0.0
remote: Installing backports 3.10.3
remote: Installing colorator 1.1.0
remote: Installing diff-lcs 1.3
remote: Installing ffi 1.9.18 with native extensions
remote: 
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote: 
remote: current directory: /home/diklein/.rvm/gems/ruby-2.4.2/gems/ffi-1.9.18/ext/ffi_c
remote: /usr/bin/ruby2.3 -r ./siteconf20180103-3870-rt2cmc.rb extconf.rb
remote: mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
remote: 
remote: extconf failed, exit code 1
remote: 
remote: Gem files will remain installed in /home/diklein/.rvm/gems/ruby-2.4.2/gems/ffi-1.9.18 for inspection.
remote: Results logged to /home/diklein/.rvm/gems/ruby-2.4.2/extensions/x86_64-linux/2.3.0/ffi-1.9.18/gem_make.out
remote: Installing forwardable-extended 2.6.0
remote: Installing rb-fsevent 0.10.2
remote: Installing kramdown 1.15.0
remote: Installing liquid 4.0.0
remote: Installing mercenary 0.3.6
remote: Installing rouge 2.2.1
remote: Installing safe_yaml 1.0.4
remote: Installing rack 1.6.8
remote: Installing tilt 2.0.8
remote: Installing multi_json 1.12.2
remote: Installing jekyll-paginate 1.1.0
remote: Installing mini_portile2 2.3.0
remote: Installing rspec-support 3.7.0
remote: Using bundler 1.11.2
remote: Installing addressable 2.5.2
remote: An error occurred while installing ffi (1.9.18), and Bundler cannot continue.
remote: Make sure that `gem install ffi -v '1.9.18'` succeeds before bundling.
remote: /usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:94:in `block in materialize': Could not find ffi-1.9.18 in any of the sources (Bundler::GemNotFound)
remote: from /usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:87:in `map!'
remote: from /usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:87:in `materialize'
remote: from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:137:in `specs'
remote: from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:182:in `specs_for'
remote: from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:171:in `requested_specs'
remote: from /usr/lib/ruby/vendor_ruby/bundler/environment.rb:18:in `requested_specs'
remote: from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:13:in `setup'
remote: from /usr/lib/ruby/vendor_ruby/bundler.rb:92:in `setup'
remote: from /usr/lib/ruby/vendor_ruby/bundler/setup.rb:18:in `<top (required)>'
remote: from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
remote: from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
```

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 3:27pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/19 "2018-01-03T15:27:37Z")

</div>

It’s working! It’s working! Thank you so much!

Question: It took approximately 1 minute to deploy because of all this. Is that the new normal for me? I saw a long pause here:

`remote: Installing nokogiri 1.8.1 with native extensions`

---

<div class="post-metadata">

**Author:** ![diklein](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/diklein/32/60_2.png) [@diklein](https://talk.jekyllrb.com/u/diklein)\
**Post date:** [January 3, 2018, 3:34pm UTC](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320/20 "2018-01-03T15:34:12Z")

</div>

Note: Deploying the next time only took a few seconds!

Thank you all so much for your help!!

[Next page](https://talk.jekyllrb.com/t/deploy-with-jekyll-paginate-v2-fails/1320.md?page=2)
