Trouble getting a specific version of Jekyll - Windows - ruby

How do I switch my version of Jekyll or download a specific version of it? This is all new to me and upon following the instructions provided by https://jekyllrb.com/docs/installation/windows/
I was able to get the specific Ruby version I wanted with the RubyInstaller+DevKit but every time I use "gem install Jekyll bundler" it gives me only the most recent version of Jekyll. How would I proceed to get Jeyll version 3.8.2 for example?
I've tried to install a specifc version from the command line with gem install jekyll -v 3.8.2 and it installs but how do I switch versions now? I also tired using 3.8.2 serve --watch to switch versions but it just gives me:
Configuration file: none
Source: C:/Users/Drey
Destination: C:/Users/Drey/_site
Incremental build: disabled. Enable with --incremental
Generating...
jekyll 3.8.2 | Error: Permission denied # rb_sysopen - C:/Users/Drey/NTUSER.DAT
Traceback (most recent call last):
23: from C:/Ruby27/bin/jekyll:23:in <main>' 22: from C:/Ruby27/bin/jekyll:23:in load'
21: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/exe/jekyll:15:in <top (required)>' 20: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program'
19: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in go' 18: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute'
17: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in each' 16: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute'
15: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/commands/serve.rb:75:in block (2 levels) in init_with_program' 14: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/commands/serve.rb:93:in start'
13: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/commands/serve.rb:93:in each' 12: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/commands/serve.rb:93:in block in start'
11: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/commands/build.rb:36:in process' 10: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/commands/build.rb:65:in build'
9: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/command.rb:28:in process_site' 8: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/site.rb:69:in process'
7: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/site.rb:164:in read' 6: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/reader.rb:16:in read'
5: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/reader.rb:45:in read_directories' 4: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/reader.rb:45:in select'
3: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/reader.rb:46:in block in read_directories' 2: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/utils.rb:146:in has_yaml_header?'
1: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/utils.rb:146:in open' C:/Ruby27/lib/ruby/gems/2.7.0/gems/jekyll-3.8.2/lib/jekyll/utils.rb:146:in initialize': Permission denied # rb_sysopen - C:/Users/Drey/NTUSER.DAT (Errno::EACCES)

So to install Jekyll v3.8.2 on Windows, definitely use Ruby 2.7 which looks like you have installed.
Since you already have a project, run:
gem install jekyll -v 3.8.2
Now open the Gemfile and update the line
gem "jekyll", "~> 3.8.2"
It should look like this on a fresh install:
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.2"
Next is installing everything, using bundler install. If that works correctly, then its time to check if its working.
bundle exec jekyll --version
>> jekyll 3.8.2
You can also try running gem add webrick if things aren't working still.
I had issues with kramdown as well, so make sure that is at 1.14

Related

bundle exec jekyll serve > Conflict: The following destination is shared by multiple files

Environment
Windows 10
ruby 3.0.0p0
jekyll 4.2.0
bundler
Steps to get here
installed ruby and jekyll using instructions: https://jekyllrb.com/docs/installation/windows/#installation-via-rubyinstaller
cloned existing jekyll repository (uses minimal mistakes theme)
successfully executed bundle update to update all the dependencies.
manually installed wdm
Gemfile looks like this:
source "https://rubygems.org"
gemspec
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Issue
jekyll serve and bundle exec jekyll serve commands fail with the following error:
$ bundle exec jekyll serve
Configuration file: C:/Users/linds/ueducateus-website/_config.yml
Source: C:/Users/linds/ueducateus-website
Destination: C:/Users/linds/ueducateus-website/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
Conflict: The following destination is shared by multiple files.
The written file may end up with unexpected contents.
C:/Users/linds/ueducateus-website/_site/index.html
- index.html
- index.html
- index.html
- index.html
- index.html
done in 1.511 seconds.
Auto-regeneration: enabled for 'C:/Users/linds/ueducateus-website'
------------------------------------------------
Jekyll 4.2.0 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `require_relative'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `setup'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:100:in `process'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
from C:/Ruby30-x64/bin/jekyll:23:in `load'
from C:/Ruby30-x64/bin/jekyll:23:in `<main>'
Additional
Site builds successfully on Ubuntu 18.04, with Ruby 2.5.1 and Jekyll 4.0
Unfortunately for handover, the site files need to be on Windows
This issue could be related to https://github.com/kubevirt/kubevirt.github.io/issues/665
Have run jekyll serve --trace but results are the same
It seems webrick does not come bundled with ruby 3.0. Check this jekyll github issue.
From
https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/:
The following libraries are no longer bundled gems or standard
libraries. Install the corresponding gems to use these features.
sdbm webrick net-telnet xmlrpc
You have two options
Downgrade to ruby 2.5 as you have on ubuntu OR
Add gem "webrick" in Gemfile.

Ruby gem command crash shell Fastlane & Cocoapods

I am having issues running fastlane and cocoapods for a month now. Any idea what is the issue? Tried RVM, changing the version and so on but nothing works.
I reinstalled fastlane then cocopoda started working again. Now fastlane does not work, error below.
It seems like you wanted to load some plugins, however they couldn't be loaded
[22:05:14]: Please follow the troubleshooting guide: https://docs.fastlane.tools/plugins/plugins-troubleshooting/
Traceback (most recent call last):
8: from /usr/local/bin/fastlane:23:in `<main>'
7: from /usr/local/bin/fastlane:23:in `load'
6: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/bin/fastlane:23:in `<top (required)>'
5: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
4: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
3: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
2: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
1: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:50:in `run!'
/Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:411:in `parse_global_options': ambiguous option: --v (OptionParser::AmbiguousOption)
You didn't include a minimal reproducible example in your post so I can't say for sure if this is the issue because I can't see how you're invoking fastlane. I recommend that you add a complete MRE to questions so people can see exactly how you got to where you are.
That said, it's probably that you are running fastlane --v and not fastlane -v:
$ fastlane --help
...
-v, --version Display version information

No signature files found in META-INF. Cannot proceed (RuntimeError)

I am trying to use calabash-android to start a test sever on a phone in android studio. I am new to this and gotten this far thanks to tutorials.
I downloaded java, ruby, calabash-android, set-up environment variables, created a key store in the .calabash-settings, have a .debug-keystore file in my .android folder.
I am stuck as to what this problem is I can run bundle exec calabash-android resign app-debug.apk fine but when i do bundle exec calabash-android run app-debug.apk, I get the following error message. I am obviously missing something but i am unsure what:
C:\Users\Dell\AndroidStudioProjects\Calabash>bundle exec calabash-android build app-debug.apk
WARNING: skipped META-INF/CERT.RSA as unsafe
Traceback (most recent call last):
8: from C:/Ruby26-x64/bin/calabash-android:23:in `<main>'
7: from C:/Ruby26-x64/bin/calabash-android:23:in `load'
6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/bin/calabash-android:76:in `<top (required)>'
5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/bin/calabash-android-build.rb:2:in `calabash_build'
4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/lib/calabash-android/helpers.rb:162:in `fingerprint_from_apk'
3: from C:/Ruby26-x64/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/lib/calabash-android/helpers.rb:163:in `block in fingerprint_from_apk'
1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/lib/calabash-android/helpers.rb:163:in `chdir'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/calabash-android-0.5.14/lib/calabash-android/helpers.rb:177:in `block (2 levels) in fingerprint_from_apk': **No signature files found in META-INF. Cannot proceed. (RuntimeError)**
I encountered the same issue with latest available versions of ruby (v3.0.2p107) and calabash (v0.9.22).
I avoided the issue by using "bundle install" command and specifying a GemFile with previous versions.
# Contents of Gemfile
source "https://rubygems.org"
ruby "2.5.1"
gem 'calabash-android', '0.9.5'
gem 'cucumber'
gem 'rexml'
gem 'rubyzip', '1.2.1'
You may want to refer to similar issues raised such as https://github.com/calabash/calabash-android/issues/802

Cannot execute rspec using bundle exec rspec

I am pretty new at programming, just learning for a few months, and I have been trying to run rspec for a ruby project I am working on so I can become more familiar with TDD and when I try to run rspec using bundle exec rspec, I get the following exception:
Traceback (most recent call last):
14: from /usr/local/bin/rspec:23:in `<main>'
13: from /usr/local/bin/rspec:23:in `load'
12: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/exe/rspec:4:in `<top (required)>'
11: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
10: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
9: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
8: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:96:in `setup'
7: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration_options.rb:22:in `configure'
6: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration_options.rb:109:in `process_options_into'
5: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration_options.rb:109:in `each'
4: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration_options.rb:110:in `block in process_options_into'
3: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1181:in `requires='
2: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1181:in `each'
1: from /var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1181:in `block in requires='
/var/lib/gems/2.5.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1181:in `require': cannot load such file -- spec_helper (LoadError)
I think there may be something wrong with my PATH, as i had to install my gems using sudo command. When trying to make sure bundler was updated I got the following warning:
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Using bundler 2.1.4
Using byebug 11.1.1
Following files may not be writable, so sudo is needed:
/usr/local/bin
/var/lib/gems/2.5.0
/var/lib/gems/2.5.0/build_info
/var/lib/gems/2.5.0/cache
/var/lib/gems/2.5.0/doc
/var/lib/gems/2.5.0/extensions
/var/lib/gems/2.5.0/gems
/var/lib/gems/2.5.0/specifications
Using diff-lcs 1.3
Using rspec-support 3.2.2
Using rspec-core 3.2.3
Using rspec-expectations 3.2.1
Using rspec-mocks 3.2.1
Using rspec 3.2.0
my computer is currently running the most recent version of ubuntu and I am using VScode if that provides any help. My current PATH seems like it has many repeated instances of the same thing and I don't know if that is contributing to anything.
My current PATH:
/home/tom/.rbenv/bin:/home/tom/.rbenv/shims:/home/tom/.rbenv/bin:/home/tom/.rbenv/bin:/home/tom/.rbenv/bin:/home/tom/.rbenv/shims:/home/tom/.rbenv/bin:/home/tom/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
any help is greatly appreciated! I am so tired of getting hung up by this and trying to google around figuring out whats wrong hasnt been helping.

Ruby: in `require': cannot load such file -- safe_yaml/load (LoadError)

When I want to change content of the web page, I go to my local project directory and I run two commands:
jekyll build
jekyll serve
After that, my web app is running locally on my machine. When I tried to run the above commands today, I got stuck on the first of them, because the following error appeared:
$ jekyll build
Traceback (most recent call last):
5: from /usr/local/bin/jekyll:8:in `<main>'
4: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
3: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
2: from /Users/JaroslavBezdek/.gem/ruby/2.3.0/gems/jekyll-3.8.5/lib/jekyll.rb:34:in `<top (required)>'
1: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- safe_yaml/load (LoadError)
I started to look it up on the internet and found I should try to install the missing library. However, it didn't solve the problem, because the other error showed up:
$ gem install safe_yaml
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
$ sudo gem install safe_yaml
Password:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
My environment could be described as following:
$ ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
$ gem --version
3.1.1
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.1
BuildVersion: 19B88
Please, could you help me, how to solve the problem?

Resources