Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How can I view / develop my website locally? #1991

Unanswered
sudo-Boris asked this question in Q&A
Discussion options

Hi! 👋
How would I go on to develop my website locally? Constantly pushing a minor change and letting the GitHub pages action build the website seems suboptimal.

When I want to host locally by running bundle exec jekyll liveserve the page is not found and when I refresh it I get redirected to the website hosted by GitHub pages.

Do I have to change something in the _config.yaml?

Once I open localhost I also get this error message:

[2023年03月01日 04:15:01] ERROR NoMethodError: undefined method `key?' for nil:NilClass\n\n return unless @mime_types_charset.key?(typ)\n ^^^^^
 /Users/borismeinardus/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve/servlet.rb:191:in `conditionally_inject_charset'
 /Users/borismeinardus/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve/servlet.rb:176:in `do_GET'
 /Users/borismeinardus/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/hawkins-2.0.5/lib/hawkins/servlet.rb:134:in `do_GET'
 /Users/borismeinardus/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/webrick-1.8.1/lib/webrick/httpservlet/abstract.rb:105:in `service'
 /Users/borismeinardus/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/webrick-1.8.1/lib/webrick/httpservlet/filehandler.rb:242:in `service'
 /Users/borismeinardus/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:140:in `service'
 /Users/borismeinardus/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:96:in `run'
 /Users/borismeinardus/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/webrick-1.8.1/lib/webrick/server.rb:310:in `block in start_thread'
You must be logged in to vote

Replies: 5 comments 2 replies

Comment options

Try with bundle exec jekyll serve

You must be logged in to vote
0 replies
Comment options

Hi,
I was trying to get my website locally (in VC code) and after more than an hour I've succeeded :)
I've written following readme, maybe it will help :

`to run this website localy:
0) instal ruby on rails and jekyll: https://jekyllrb.com/docs/installation/macos/

  1. change the GemFile as follow:
    comment the line:
    #gem "github-pages", group: :jekyll_plugins
    uncomment following lines:
    gem "jekyll"
    gem "jekyll-paginate"
    gem "jekyll-gist"
    gem "jekyll-redirect-from"
    gem "kramdown-parser-gfm"
    gem "webrick"

  2. bundle install

  3. bundle exec jekyll serve

  4. open http://127.0.0.1:4000/ in your browser`

You must be logged in to vote
1 reply
Comment options

Appreciate you! @PatrykPrezyna

Comment options

liveserve is not possible anymore?

You must be logged in to vote
0 replies
Comment options

Hi, I was trying to get my website locally (in VC code) and after more than an hour I've succeeded :) I've written following readme, maybe it will help :

`to run this website localy: 0) instal ruby on rails and jekyll: https://jekyllrb.com/docs/installation/macos/

1. change the GemFile as follow:
 comment the line:
 #gem "github-pages", group: :jekyll_plugins
 uncomment following lines:
 gem "jekyll"
 gem "jekyll-paginate"
 gem "jekyll-gist"
 gem "jekyll-redirect-from"
 gem "kramdown-parser-gfm"
 gem "webrick"
2. bundle install
3. bundle exec jekyll serve
4. open http://127.0.0.1:4000/ in your browser`

Thanks! this helped

You must be logged in to vote
0 replies
Comment options

I made changes locally, and the website is visible locally as expected. I used "bundle exec jekyll serve" to open it locally. However, it failed to build on GitHub. The error message lists all files in_publicaiton, _data, and other folders.

Error: Logging at level: debug Configuration file: /github/workspace/./_config.yml GitHub Pages: github-pages v232 GitHub Pages: jekyll v3.10.0 Theme: jekyll-theme-primer Theme source: .........................

You must be logged in to vote
1 reply
Comment options

It might be better to create a new thread for this, also more of the log would be needed for troubleshooting as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
faq Frequently Asked Questions
Converted from issue

This discussion was converted from issue #1197 on March 15, 2024 02:15.

AltStyle によって変換されたページ (->オリジナル) /