Cannot run theme after creating it

Hello everyone hope your doing great,

I have a really odd error because every tutorial I seen didn’t get it and I can’t seem to find a fix online

I made a new theme using

jekyll new-theme name

and then I ran

bundle exec jekyll serve

but got this error

Could not find gem 'rake (~> 12.0) x64-mingw32' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

I’ve tried updating bundler using

gem install bundler

But to no luck

Did you try running bundle install, as the error message tells you?

I fixed the error by doing the following:

go to your sitename.gemspec file and change the following

  spec.add_development_dependency "bundler", "~> someoldversion"
  spec.add_development_dependency "rake", "~> someoldversion"

TO

  spec.add_development_dependency "bundler", "~> 2.1.4"
  spec.add_development_dependency "rake", "~> 13.0.1"

You can find the latest version of both of these packages by running

gem install {gemName}

and it should tell you which version it installed just take that version number and put it in the gemspec file

Hope this helps someone :smiley:

Install bundle at the user level

gem install bundler --user-level

Configure in your project before running

cd project 
bundle config --local path vendor/bundle
bundle install