Skip to content

Commit

Permalink
update ruby config
Browse files Browse the repository at this point in the history
  • Loading branch information
sujaykundu777 committed Jul 10, 2024
1 parent 90ca90c commit 08cc321
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.1.2
ruby-3.3.4
2 changes: 1 addition & 1 deletion DEPLOY_STRATEGY
Original file line number Diff line number Diff line change
@@ -1 +1 @@
none
gh-pages
17 changes: 11 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
source "https://rubygems.org"

gem 'jekyll', '~> 4.3.2'
gem 'bundler', '~> 2.3.7'
gem 'jekyll', '~> 4.3.3'
gem 'bundler', '~> 2.5.15'
gem 'faraday-retry'
gem 'backports', '~> 3.23'
gem 'backports', '~> 3.25.0'
gem 'kramdown'
gem 'puma'

gem 'csv'
gem 'base64'

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# you can read more about it here
# https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll
# https://pages.github.com/versions/

# Plugins
group :jekyll_plugins do
# gem 'devlopr', '~> 0.4.5'
gem 'jgd', '~> 1.12'
gem 'jgd', '~> 1.14.0'
gem 'jekyll-feed', '~> 0.17.0'
gem 'jekyll-paginate', '~> 1.1.0'
gem 'jekyll-gist', '~> 1.5.0'
gem 'jekyll-seo-tag', '~> 2.8.0'
gem 'jekyll-sitemap', '~> 1.4.0'
gem 'jekyll-admin', '~> 0.11.1'

# gem 'jekyll-admin', '~> 0.11.1'
end


Expand Down
117 changes: 57 additions & 60 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
backports (3.23.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
backports (3.25.0)
base64 (0.2.0)
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.2.0)
concurrent-ruby (1.3.3)
csv (3.3.0)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
faraday-retry (2.0.0)
faraday (2.10.0)
faraday-net_http (>= 2.0, < 3.2)
logger
faraday-net_http (3.1.0)
net-http
faraday-retry (2.2.1)
faraday (~> 2.0)
ffi (1.15.5)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
forwardable-extended (2.6.0)
google-protobuf (3.21.12-x86_64-darwin)
google-protobuf (3.21.12-x86_64-linux)
google-protobuf (4.27.2-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.27.2-x86_64-linux)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.12.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jekyll (4.3.2)
jekyll (4.3.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand All @@ -39,10 +48,6 @@ GEM
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-admin (0.11.1)
jekyll (>= 3.7, < 5.0)
sinatra (>= 1.4)
sinatra-contrib (>= 1.4)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
Expand All @@ -56,86 +61,78 @@ GEM
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jgd (1.12)
jekyll (>= 1.5.1)
trollop (= 2.9.9)
jgd (1.14.0)
jekyll (>= 1)
trollop (>= 2)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.0)
mercenary (0.4.0)
multi_json (1.15.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.8)
net-http (0.4.1)
uri
nio4r (2.7.3)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.1)
puma (6.0.2)
public_suffix (6.0.0)
puma (6.4.2)
nio4r (~> 2.0)
rack (2.2.6.2)
rack-protection (3.0.5)
rack
rake (13.0.6)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (4.0.1)
ruby2_keywords (0.0.5)
rexml (3.3.1)
strscan
rouge (4.3.0)
safe_yaml (1.0.5)
sass-embedded (1.58.0)
google-protobuf (~> 3.21)
rake (>= 10.0.0)
sass-embedded (1.77.5-arm64-darwin)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86_64-darwin)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86_64-linux-gnu)
google-protobuf (>= 3.25, < 5.0)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
sinatra (3.0.5)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.0.5)
tilt (~> 2.0)
sinatra-contrib (3.0.5)
multi_json
mustermann (~> 3.0)
rack-protection (= 3.0.5)
sinatra (= 3.0.5)
tilt (~> 2.0)
strscan (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
tilt (2.0.11)
trollop (2.9.9)
trollop (2.9.10)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2022.7)
tzinfo-data (1.2024.1)
tzinfo (>= 1.0.0)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
uri (0.13.0)
wdm (0.1.1)
webrick (1.8.1)

PLATFORMS
arm64-darwin-23
universal-darwin-21
x86_64-linux

DEPENDENCIES
backports (~> 3.23)
bundler (~> 2.3.7)
backports (~> 3.25.0)
base64
bundler (~> 2.5.15)
csv
faraday-retry
jekyll (~> 4.3.2)
jekyll-admin (~> 0.11.1)
jekyll (~> 4.3.3)
jekyll-feed (~> 0.17.0)
jekyll-gist (~> 1.5.0)
jekyll-paginate (~> 1.1.0)
jekyll-seo-tag (~> 2.8.0)
jekyll-sitemap (~> 1.4.0)
jgd (~> 1.12)
jgd (~> 1.14.0)
kramdown
puma
tzinfo (~> 2.0)
Expand All @@ -144,4 +141,4 @@ DEPENDENCIES
webrick (~> 1.7)

BUNDLED WITH
2.3.7
2.5.15
76 changes: 65 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ or if you want to try fast :

## Local Development Steps :

### Clone Locally:
Step 1: Fork this repo with your github username.

Step 2: Clone Locally

```s
$ git clone https://github.com/your_github_username/your_github_username.github.io.git
$ cd your_github_username
```

Step 3: Now follow the below guides based on your OS.

### For Linux : (Ubuntu 20.04)

To work locally with ubuntu, follow this commands.
Expand Down Expand Up @@ -96,51 +101,100 @@ $ bundle exec jekyll serve
Start the server locally at http://127.0.0.1:4000/ or http://localhost:4000/

### For MacOS :

Run the following in your terminal :

1. Install Homebrew
#### Option 1. Install ruby using Homebrew

`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`

`brew install ruby`

Add the below in ~/.zshrc file:

Edit either the ~/.zshrc and ~/.zprofile files:

`$ open -e ~/.zshrc`

### For Mac M1, M2, M3

```sh
# override system ruby with homebrew-installed ruby
if [ -d "/opt/homebrew/opt/ruby/bin" ]; then
export PATH=/opt/homebrew/opt/ruby/bin:$PATH
export PATH=`gem environment gemdir`/bin:$PATH
```
### For Mac Intel
On Mac Intel, add this at the end of your ~/.zshrc or ~/.zprofile file.
```sh
if [ -d "/usr/local/opt/ruby/bin" ]; then
export PATH=/usr/local/opt/ruby/bin:$PATH
export PATH=`gem environment gemdir`/bin:$PATH
fi
```
Save the file. This sets the Homebrew-installed Ruby to a higher priority than the system Ruby and adds the directory used for Ruby gems.
### Reset the shell session
Close and reopen the Terminal window to pick up the changes to the configuration file. Or enter source ~/.zshrc or source ~/.zprofile to reset the shell environment without closing the Terminal window.
```sh
$ source ~/.zprofile
$ source ~/.zshrc
```
The source command reads and executes a shell script file, resetting the shell environment.
You should be able to see this :
```sh
$ ruby -v
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [arm64-darwin23]
```
2. Install churby and ruby-install with Homebrew
`brew install chruby ruby-install`
We will be using [ruby-install](https://github.com/postmodern/ruby-install) to install ruby and [chruby](https://github.com/postmodern/chruby) to change the current ruby version.
3. Install latest ruby version
`brew install chruby ruby-install`
Install latest ruby version
`ruby-install ruby`
4. This will take a few minutes, and once it’s done, configure your shell to automatically use chruby:
This will take a few minutes, and once it’s done, configure your shell to automatically use chruby:
```sh
echo "source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh" >> ~/.zshrc
echo "source $(brew --prefix)/opt/chruby/share/chruby/auto.sh" >> ~/.zshrc
echo "chruby ruby-3.1.2" >> ~/.zshrc
echo "chruby ruby-3.3.4" >> ~/.zshrc
```
If you are facing any problems not getting the version that you just now installed, here is a amazing guide :
[how to uninstall ruby on mac](https://mac.install.guide/ruby/9)
If you’re using Bash, replace *.zshrc* with *.bash_profile*.
Quit and relaunch Terminal, then check that everything is working:
`$ ruby -v`
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [arm64-darwin23]
5. Install latest gems
```s
```sh
$ gem install jekyll bundler
$ gem update --system 3.5.15

$ bundler -v
Bundler version 2.3.23
Bundler version 2.5.15

$ bundle update

$ bundle exec jekyll -v
jekyll 4.2.2
jekyll 4.3.3

$ bundle exec jekyll serve --livereload
```

### Security
We use codeQL and dependabot alerts for vulnerabality analysis & fixes.
Expand Down
Loading

0 comments on commit 08cc321

Please sign in to comment.