Publish to Github, github-pages can't satisfy your Gemfile's dependencies

Hi,

  • I followed the basic tutorial from the Jekyll website.
  • I then pushed it to github, assigned SSH key.
  • During Github action build I get this error:
    github-pages can't satisfy your Gemfile's dependencies.

I already went through different trials and test from other repositories.

My full repository is attached here:
panelized_timber_vaulted_floors-main.zip

  • can you link to your repo on GH rather than posting the zip?
  • rather than a screen shot of the error pasting the actual text is helpful as we can copy and paste things to google. You can paste it into a code block by putting 3 back tics ``` above and below it.

You might try deleting the gemfile (assuming you have it backed up somewhere) as it isn’t always required.

I think your issue is you made the gemfile locally with a newer version that what GH has installed? though I am not sure why that would be an issue.

1 Like

After deletion the page is deployed but it looks like this on the left, but on the right is what i see locally:
There is certainly something with the gemfile, but I do not know what.
I will also make it public to post the link here.
Do you have any ideas why this happens?

most likely the css path is incorrect - most common issue is not setting the baseurl in the config file, though this assumes you are using a theme or something that someone built that uses the baseurl which is usually the case.

GH project repos are served as sub folders, so your paths to the css need to have the name of the repo as part of the path and this is usually done via the baseurl in the config file. Without it the browser will look for the css in the wrong place, not find it and you end up without styles.

In your browser right click anywhere on the page and select Inspect then click on the console tab and you will probably see an error loading the css and maybe some other stuff, seeing the path there may help it make sense.

Could you please take a look at the repository? Thank you very much

  • The page is not using any plugin
  • I tried to set the baseurl in the config file

petrasvestartas/panelized_timber_vaulted_floors (github.com)

These are the errors

_config.yml

# _config.yml


# Build settings
baseurl: /panelized_timber_vaulted_floors
url: http://petrasvestartas.github.io

collections:
  authors:
    output: true

what is the link to the live site?

did you make the layout/theme yourself or is this from something else?

The link is following, I made it myself, by following the jekyll tutorial, it is very basic:

Home (petrasvestartas.github.io)

in your default layout you have this as your css:

<link rel="stylesheet" href="/assets/css/styles.css">

that is incorrect as it is not using the baseurl. Try changing it to:

<link rel="stylesheet" href={{"/assets/css/style.css" | relative_url }}

this is a jekyll filter that will automatically prepend the baseurl if one is set in the config. I’m not 100% sure I have the formatting correct but I think so.

Thank you. The style e.g. font changed.
But all the images and navigation bar is still missing.

What should I do better that all the linking would be correct?

I should say that all links to assets need to be like that if you are going to use GH for hosting as they are serving it from a subfolder.

If you host somewhere else this won’t be an issue most likely. I use AWS Amplify and there is no need for a baseurl so I don’t have to worry about it.

You can hard code the urls with the value of the baseurl but that is a terrible idea as you would have to change everyone one of them if you ever changed it so having it be in the config file is highly recommended.

right -and I guess all the urls to within your site need the same filter to prepend the baseurl. Sorry, I don’t use GH hosting so I forget all the little things like that.

The browser inspector is your friend here, you can also edit the urls in the browser to add in the missing baseurl to help troubleshoot things. You can even edit the actual html on the elements tab of the Inspector and change paths there to see what works but it is only a temporary thing until the page reloads but can be very handy.

I cannot still properly link .css styles.

There are no errors in the Inspect of the webpage.
But it is weird that text font (Open Sans) is changed from default one which means the .css is doing something, but there is no padding on left and right, nor the navigation bar grey rectangle.

Could you please take a look at the repository and give me an advice how to link the .css correctly?

---
---
@import "main";

body {
    padding-left: 25%;
    padding-right: 25%;
    font-family: "Open Sans", Times, serif;
    text-align: justify; 
    }

Repo:
petrasvestartas/panelized_timber_vaulted_floors (github.com)

Preview:
Home (petrasvestartas.github.io)

in your layout you are calling the css file style.css but it is really styles.css with an s at the end. Change that and it should work.

I have no idea how it is pulling in a style.css file, it should not exist as far as I can tell.

also you are commiting the _site folder to your repo, usually you don’t do that as it is not needed. At least I don’t think it should be for you and it can be a firther source of confusion.

The site is being built from the source, the _site folder is not part of that.

Also, from the looks of it you could use GH pages to build the site rather than the action I think you are using, again that makes it simpler and more predictable, though if you plan to use a plugin or theme you may need the action.

There are people who commit the _site folder only, but that is another topic and probably should be avoided.

1 Like

It works. Without you this would be impossible. Thank you a lot :slight_smile:

I will skip the _site folder.

How can I run this, would this work by default if I remove the file " github-pages.yml" ?:
Also, from the looks of it you could use GH pages to build the site rather.

I don’t use actions so I am not that sure - but I think if you remove that it will try to build it normally.

Also what are the run/build.bat files for?

You may also need to work on the seo plugin, you have that in your layout but the plugin is not set in the config file (or the gemfile?). I don’t use plugins so I am not exactly sure how you are supposed to use it, I know you removed the gemfile earlier. The seo plugin doesn’t really do much, you can add in the same things is adds in the layout and skip it fairly easily.

You may also be able to ditch the gemfilelock file, I don’t use either one of the gemfiles, that is bad practice but it simplifies things and unless you are using different plugins and working on multiple different sites I am not sure it is worth much. I try to run with the simplest setup possible (no plugins no themes).

Hi,

I just adjusted all these points. The bat files were just because I forget the build and run commands of jekyll :slight_smile:
Now I removed the git workflows, unnecessary plugin links since I am not using them, also gemfile.lock.

It seems to be tidy and small right now. Which awesome.
Thank you so much for your help. :tada: