How to install Jekyll?

When I open an empty repository and type “gem install jekyll bundler” everything is installed without warning. When executing the same command in a Dockerfile via “USER gitpod RUN gem install jekyll bundler” I get some “permission denied” error messages.

What do I have to do to have Jekyll installed in my Gitpod workspace?

[original thread by Thomas Driessen]

Hi @sandared,

when inheriting from workspace-full you typically have to do RUN bash -lc “gem install jekyll bundler” because a lot of the language tools (such as gem) are configured in .bashrc, which is only parsed for login shells (thus the bash -l).
Verifying with your command…

Yes, works. :slight_smile:

Thank you :slight_smile: works like a charm :slight_smile:

After thinking about this: Technically it’s not necessary and we could improve here:

I’m having trouble installing Jekyll even after trying to follow the advice in this topic.

I copied the contents of .gitpod.yml and Dockerfile from Sandared’s repo to my repo, but when I start a new workspace, it doesn’t make it to server startup with the message “Could not find i18n-0.9.5 in any of the sources” and asks me to run bundle install.

If I run bundle install manually at that point, I can then run bundle exec jekyll serve successfully.

What am I missing? Thanks!

Hi @pglevy! Welcome to the Gitpod community :tada:

I opened a fresh new workspace from your repo and got it to work. I’ve attached a screenshot of what I can see. Can you try opening a completely new workspace?

Hi Pauline,

Thanks for taking a look for me! I’m encouraged to see you got it working, but I still can’t get it to run. I tried creating a new workspace from the same repo, but I still get “Could not find i18n-0.9.5 in any of the sources.”

I’m even more confused now because I thought the point was that if it’s working on gitpod, it works for everyone. I must be doing something wrong. :pensive:

That is strange! I’m trying to understand what could’ve caused this :thinking: You are definitely not doing anything wrong, your configuration clearly works! I have a theory but can’t prove it just yet.

Prebuilds haven’t worked for me recently (that’s a separate thing I need to look into) so it didn’t trigger when I opened a workspace with your repo. Based off your screenshot, it looks like it did.

Can you maybe try removing your prebuild configuration and then open a new workspace?

How do I “remove prebuild configuration”?

From line to 10-21 - comment it out.

Ah! I think I’m getting somewhere. Commenting out those lines didn’t seem to work because it was still coming right up (and with the message “ran as a workspace prebuild”).

So I started a new branch, removed all the prebuild config lines, and tried again. (I also tried uninstalling the gitpod app from the repo, but not sure what that did because I still seemed to get the pre-existing prebuild without it.)

After that, starting a new workspace built and ran the environment successfully. (I did have to sit through the install though.)

So I know I can get it to work but what do you recommend I do moving forward?

1 Like

Ah ha! Thank you for coming back here and explaining what you did, it might help others if it were to happen again. I thought it was related to prebuilds, but I’m still trying to understand why it happened in the first place. :thinking:

So when you open a completely new workspace in your main branch, the prebuild still happens? And therefore you cannot see your Jekyll preview? But it does work in your no-prebuild branch?

If so, can you try and “force” a new prebuild on top of your main branch by:
Pushing another change to your branch, this should trigger a new prebuild

Or manually force a prebuild, using:<user>/<repo>

Let’s see if that fixes it on your main branch!

So the manually forced prebuild didn’t work. I saw it go through the prebuild process, but it ended up with the same error once it tried to start up. (This repo is a fork, btw… would that be an issue?)

I leave it here since for now since I got it working on another branch. I’ll give it a shot on a new repo at some point and see how it goes starting from scratch.

Thanks for all your help, Pauline. Really appreciate it!

No worries at all! I’m sorry that I couldn’t get to the bottom as to why your main branch wasn’t showing the preview. Please feel free to get in touch again! Also, just to let you know we have a community Discord server that you’re welcome to join. It might be useful for things you may want to discuss with the community (and us) in the future. :blush: I’ll close this thread for now.