GIT command not found on Fedora 18 - ruby-on-rails

I am trying to deploy a Rails application using Capistrano. My application is on a Git repository on BitBucket.
Before deploying the application I needed to install Git on the server running Fedora 18. I tried the following:
sudo yum install git
and
sudo yum install git-core
Both commands showed that Git was installed successfully, but when I try to use the git command I receive a git command not found error.
How can I install Git with Fedora 18 and make this work?
SOLVED: Although, Fedora wrote that git has been installed, it was not. I tried to re-install git, following carefully what was written in the terminal during the installation and it worked.

Related

Trying to install aws-sam-cli through brew on ubuntu using "brew tap aws/tap" command ,getting error "fatal: Could not resolve HEAD to a revision"

just installed homebrew , brew --version gives below output
Homebrew 2.7.7
Homebrew/linuxbrew-core (no Git repository)
i have git version 2.27.0 installed , now im trying to run "brew tap aws/tap" command but getting the error "fatal: Could not resolve HEAD to a revision".
im using ubuntu version 20.04
git -C $(brew --repo homebrew/core) checkout master - this worked for me
Reference this issue - Installing upx with Mac Big Sur

How can I downgrade Homebrew to an older version?

Currently I have the latest version 2.2.17, I want to downgrade to version 2.2.12.
Brew does not have a downgrade option, just an upgrade. Is the process to uninstall brew and re-install it again?
If you used the normal installation way via the install script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then take a look at the brew install script (it has its own repo).
It downloads the actual Homebrew repo to /usr/local/Homebrew.
...
HOMEBREW_PREFIX="/usr/local"
HOMEBREW_REPOSITORY="/usr/local/Homebrew"
...
BREW_REPO="https://github.com/Homebrew/brew"
...
ohai "Downloading and installing Homebrew..."
(
cd "${HOMEBREW_REPOSITORY}" >/dev/null || return
# "git remote add" will fail if the remote is defined in the global config
execute "git" "config" "remote.origin.url" "${BREW_REPO}"
execute "git" "config" "remote.origin.fetch" "+refs/heads/*:refs/remotes/origin/*"
...
execute "ln" "-sf" "${HOMEBREW_REPOSITORY}/bin/brew" "${HOMEBREW_PREFIX}/bin/brew"
...
}
...
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
...
The script installs the latest copy of the Homebrew repo. So the answer to "Is the process to uninstall brew and re-install it again?" would be a "NO". Instead, install it first normally, and then after, go over to /usr/local/Homebrew and checkout the version you want.
~$ cd /usr/local/Homebrew
Homebrew$ brew --version
Homebrew 2.3.0
Homebrew/homebrew-core (git revision d41d92; last commit 2020-05-29)
Homebrew$ git fetch --tags
Homebrew$ git checkout 2.2.12
Note: switching to '2.2.12'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 2ae26808a Merge pull request #7301 from Bo98/cmake-sdkroot
Homebrew$ brew --version
Homebrew 2.2.12
Homebrew$ cd /usr/local/bin
bin$ ./brew --version
Homebrew 2.2.12
Homebrew/homebrew-core (git revision d41d92; last commit 2020-05-29)
I recommend doing a brew doctor after just to make sure everything's still OK.
Then, unfortunately, Homebrew always auto-updates itself every time you install something. So it will always update the repo at /usr/local/Homebrew up again to the latest version. You can disable that by exporting HOMEBREW_NO_AUTO_UPDATE as mentioned here https://github.com/Homebrew/brew/issues/1670.
~$ export HOMEBREW_NO_AUTO_UPDATE=1
~$ brew install python#3.8
You'll need to create an alias or auto-export that env var to your bash_profile (or whatever is the equivalent for the terminal you use), so that it takes effect every time you use brew.

facing issue with Install the Heroku CLI on Ubuntu 18 with rails

I am trying to run heroku on my terminal with heroku login command but everytime it show me this message
Install the Heroku CLI from https://cli.heroku.com
If i do heroku -v , heroku run rails c in all command it show me this same error
i did Gem install heroku it id done successfully.
than after same error everytime
Please help me to find solution about it.
You can't install the heroku CLI through rubygems (gem install).
You have to install following the guide here: https://devcenter.heroku.com/articles/heroku-cli#download-and-install
On Ubuntu install it with the following command: sudo snap install heroku --classic
On MacOS, if you have Homebrew installed, run brew install heroku/brew/heroku, otherwise download an installer and install Heroku using it.
If you want to run Heroku CLI, you need to install heroku in your ubuntu system.
on ubuntu 16+ versions you can install heroku cli with below command.
sudo snap install heroku --classic
you can't use any heroku command until its installed in your system

Installing ruby sudo make command not found (Vagrant, Virtualbox)

I am trying to get a development environment up and running. I installed virtualbox and then used vagrant with the hashicorp/precise32 box. I access the VM through ssh and am trying to install the latest version of ruby.
I pasted
wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
tar -xzvf ruby-install-0.5.0.tar.gz
cd ruby-install-0.5.0/
sudo make install
into the command line from https://github.com/postmodern/ruby-install#readme
The prompt shows sudo make install and when I hit enter I get a message that says "sudo: make: command not found."
What am I doing wrong?
I know there are boxes with ruby already setup but I wanted to go through the process myself so learn a bit along the way.
A separate issue I came across was that this box has an outdated version of ubuntu. When I try to upgrade it warns me not to do it over SSH. Is there a better way?
Thanks
Maybe you don't have make installed on Ubuntu. You can install the package build-essential which will install make and other building tools.
sudo apt-get install build-essential
also, here's a good reference on installing Ruby, Ruby on Rails, and other tools on Ubuntu.

Installing Rails Plugin Requires Git?

Installing rails plugins from github requires git in the system?
OS is linux. Is it possible to install plugin without git installation in the local system.
Sure!
download the plugin from github as *.tar.gz
uncompress and copy it to your vendor/plugins folder
run the install tasks if necassary
Good luck! ;)
OR just install git-core on your linux system :)
If using Ubuntu or Debian
sudo apt-get install git-core
HTH

Resources