Saturday, April 20, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1823  / 1 Year ago, sat, december 24, 2022, 1:32:30

I've installed Ruby, RVM, and Jekyll following this tutorial and everything works fine after following those steps.



My issue is that each time I open a new terminal window and want Jekyll to rebuild the site with jekyll build, I get the error jekyll: command not found. The temporary solution is to re-run the following two commands from the tutorial then Jekyll works:



[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"


Checking that .profile file I noticed it says 'This file is not read by bash, if ~/.bash_profile or ~/.bash_login exists'. I ran the first two commands again substituting .bash_profile for .profile and this didn't seem to have any effect.



[[ -s "$HOME/.bash_profile" ]] && source "$HOME/.bash_profile"


I still get the Jekyll error and my .bash_profile file exists but is completely empty.



Is there a more permanent fix or am I stuck running the first two commands every single time I open a terminal to rebuild a site with Jekyll?


More From » command-line

 Answers
1

~/.bashrc will be called for interactive + non-loginshell



whereas ~/profile will be called for interactive + login shell



The recommended way is putting



[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 


in the ~/.profile itself but in .bash_profile put source "$HOME/.profile.



And the second way way would be to add



`[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" `


in your .bashrc.



Here is why the second way is not much recommended.



More on .bashrc,.profile and bash_profile.


[#26219] Monday, December 26, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iedncommon

Total Points: 200
Total Questions: 95
Total Answers: 132

Location: Tonga
Member since Mon, Aug 2, 2021
3 Years ago
;