ayastreb / jekyll-maps

:earth_americas: Embed maps with filterable locations in Jekyll
https://ayastreb.me/jekyll-maps/
MIT License
134 stars 41 forks source link

Liquid Exception: no implicit conversion of String into Integer #16

Closed gpldecha closed 7 years ago

gpldecha commented 8 years ago

I am trying out this plugin which looks great but I run in a bit of trouble. I followed the installation instructions but when I try to generate a map I get the following error:

jekyll 3.2.1 | Error:  no implicit conversion of String into Integer

Here is an example

#contact.md

---
location:
  latitude: 48.8587741
  longitude: 2.2074741

---

{% google_map %}

Any thoughts ? I am new to jekyll.

ayastreb commented 8 years ago

Hi @gpldecha,

thanks for reporting it. I plan to handle this issue in the following days, I'll let you know when it's fixed.

Cheers

ayastreb commented 8 years ago

Hi @gpldecha,

I've released a new version of the plugin today which should be working now with your example! Please, update and let me know if it works.

gpldecha commented 8 years ago

Hi @ayastreb ,

So I installed your new version:

gem install jekyll-maps

Successfully installed jekyll-maps-2.0.0
Parsing documentation for jekyll-maps-2.0.0
Installing ri documentation for jekyll-maps-2.0.0
Done installing documentation for jekyll-maps after 0 seconds

in _config.yaml I have the following line:

maps:
  google:
    api_key: AIzaSyAAWxrvFCt4YV4nchBl_8uMaso8So5KiHY

gems:
  - jekyll-maps

and in Gemfile:

gem 'jekyll-maps'

I have tried but I am getting a different error: Liquid syntax error (line 1): Unknown tag 'google_map'

My jekyll website (check devel branch).

Once this problem solved a simple working jekyll website example, ready to download would be great I think.

ayastreb commented 8 years ago

Hi @gpldecha,

how do you run jekyll? I've tried to check out your code, run bundle install and bundle exec jekyll serve and it renders ok. can you run gem list | grep jekyll and see which versions are installed?

gpldecha commented 8 years ago

Hi @ayastreb,

I checked gem list | grep

jekyll-maps (2.0.0, 1.1.6)`

and it looks like two versions are installed. How do I remove one of them ?

You run the devel branch of my website locally and you had no problems ?

ayastreb commented 8 years ago

Yes, I tried it on devel branch. I noticed that in Gemfile.lock in devel branch you still have jekyll-maps (1.1.6). Try to run bundle update to update your installation. Also you can delete old version with gem uninstall jekyll-maps

gpldecha commented 8 years ago

Ok did gem update etc and in Gemfile.lock only one version present (I pushed it).

I got a new error with the previous one.

GitHub Metadata: GET https://api.github.com/repos/gpldecha/gpldecha.github.io/pages: 404 - Not Found // See: https://developer.github.com/v3
  Liquid Exception: Liquid syntax error (line 1): Unknown tag 'google_map' in _pages/contact.md

Not sure what the first is all about, going to have to do some debugging. I will let you know when I have resolved this.

ayastreb commented 7 years ago

hi @gpldecha I've lost track of this issue :) Are there any updates, did you manage to fix it?

Someone else had a similar issue today (Unknown tag 'google_map') and it was caused by missing jekyll-maps in _config.xml, it should be in gems section, e.g. in your case:

gems:
  - jekyll-paginate
  - jekyll-sitemap
  - jekyll-gist
  - jekyll-feed
  - jekyll-maps
  - jemoji
  - gif_tag

let me know if it works for you!

kevindelord commented 7 years ago

Hi @ayastreb !

I'm having the Unknown tag 'google_map' when I push on Github. Locally it all works super fine.

The Github error:

The tag `google_map` on line 2 in `index.html` is not a recognized Liquid tag.

As far as I know I did setup properly the project and the gem as it all works fine... locally.

The Gemfile:

source 'https://rubygems.org'

gem 'json', '~> 1.8.5'
gem 'github-pages'
gem 'jekyll-maps'

Some part of my _config.xml:

gems:
  - jekyll-paginate
  - jekyll-sitemap
  - jekyll-maps
  - jemoji

maps:
  google:
    api_key: THEKEY

Here is the repo: https://github.com/kevindelord/picturemyworld.github.io Branch: gh-pages

ayastreb commented 7 years ago

Hi @kevindelord unfortunatelly Github Pages only support a limited list of plugins - https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/ and jekyll-pages is not one of them 😄 If you want to use jekyll-maps you need to build the site yourself and push it to gh-pages.

kevindelord commented 7 years ago

Hi @ayastreb! thanks for the quick answer.

Following your advice I've removed the gem and have integrated the plugin like this:

/_plugins/jekyll-maps/jekyll-maps.rb /_plugins/jekyll-maps/lib/google_map_api.rb /_plugins/jekyll-maps/lib/...all the other .rband .js files.

In the jekyll-maps.rb, I've updated the requirements to match the new paths

require_relative "lib/google_map_api"

So basically I have the very strict minimum code in my repository.

But once again, it all works fine locally but when I push it to GH I receive the same error:

The tag `google_map` on line 2 in `index.html` is not a recognized Liquid tag.

Did I forget something somewhere?

Thanks!

PS: great article by the way!

ayastreb commented 7 years ago

Hi @kevindelord Sorry, I might had been misleading, I meant that with Github Pages it is not possible to use 3rd party plugins at all. If you need to use jekyll-maps (or any other 3rd party Jekyll plugin) - you need to build your site first and push it to gh-pages branch.

There are many ways how you can do it. I'm using Grunt build-control. It's also possible to use Travis CI and run some tests along it - https://felixrieseberg.com/deploy-jekyll-pages-using-git-and-travis-ci/ There is also Kickster - https://github.com/nielsenramon/kickster#kickster made specifically for this use-case.

Let me know if you need any help with that!

kevindelord commented 7 years ago

Hi @ayastreb,

Thanks for your help and good work on that library it all works perfectly now :)

For further notice, this is how I deployed my website with jekyll-maps on it.

  1. Make sure npm and bower are installed locally.

  2. Create a bower.json file like:

    {
    "name": "mywebsitename",
    "dependencies": {
    }
    }
  3. Simply add locally the deploy script from kickster to your repository.

  4. And from master run the deploy script. It will build your website and push it to the gh-pages branch.

Cheers!