Install Git on CentOS 7 LEMP stack - linux

After about 6+ days and numerous rounds of spin-up/destroy I have FINALLY gotten my Digital Ocean droplet server up and running (ie I can view a live page of content at my ip).
At this point I am trying to install Git, and have installed/removed it 3 times so far as I keep getting 'close' to completion but then run into some error I can't find an answer for. I'm hoping someone can help me figure out what my latest problem is so I can move forward with the actual development of my site rathe than spending over a week on the server build.
I have attempted to install version 2.6.2 of git on my server and have had to compile from source (something I am no where near familiar with). I 'thought' I had it correct this time, but received the following error when I attempted to set my git user name:
gitconfig --global user.name "MyUserName" (<--- last command I made)
bash: gitconfig: command not found (<-- error i received)
I thought it was an issue with being in the wrong directory to run the command, so i ran which git and received the following output:
/usr/local/git/bin/git
This seems to be a binary (?) file and none of the directories listed in that path allow me to use gitconfig command either.
Any ideas what I have done wrong? Do I need to remove (again!) and re-compile. I don't desire to be a server admin, but really had thought (hoped?) spinning my own LEMP server on CentOS 7 would be simple - doing so on CentOS 6.* was.
Thanks for your help/advice.

gitconfig isn't a command.
You'd do:
git config --global user.name "MyUserName"
Also you're really better off installing git via yum, rather than compiling from source unless there's a good reason to compile it yourself.
(Edit - updated answer with tested solution on Centos 7).

Related

how to update etherpad-lite properly?

I keep totally failing to update an etherpad-lite server. The problem: Even a Google search for the update procedure brings up hardly any information, only that one should run "git pull origin".
I have now tried this in many different ways. The update usually works, but afterwards one of these errors occurs:
Plugins can no longer be installed
The service can no longer be started (TypeError: log4js.replaceConsole is not a function)
The entire admin panel no longer works.
I tried uninstalling or updating all plug-ins before, but both hardly brought any improvements, only other errors. The update of the plugins in the admin console fails, I tried it via the updatePlugins.sh script. Here a message appears that at least etherpad-lite 1.8,6 must be installed. I am currently at version 1.8.4 and would like to update to the latest version 1.8.12. However, some of the plug-ins are still updated. A very strange behaviour.
I would be happy if someone could tell me how to properly update the etherpad-lite instance step by step. (ubuntu 20)
Thank you!
I have recently updated Etherpad-lite from version 1.8.6 to 1.8.13.
For me, executing git pull origin and then checking out the 1.8.13 release tag, with git checkout 1.8.13, made the work.
It is important, despite having Etherpad configured as a service, to run it for the first time using:
src/bin/run.sh.
Node v12.22.1
npm 6.14.12
Ubuntu 20.04.2
I hope it has been useful to you.

Unable to run node from git bash

I am no longer able to run node from the git bash terminal. It works from Git CMD and the standard windows CLI. If I try to run a file (e.g. node index.js) or even just start node via node, I go back to the input prompt except now I can't see any of my character inputs.
This is not a result of PATH not being set, as where node gives me C:\Program Files\nodejs\node.exe and which node gives me /c/Program Files/nodejs/node and echo $PATH does have /c/Program Files/nodejs included.
If I type another command (such as ls), it actually will work even though I will continue to not be able to see my input.
I think this problem arose after the latest Windows 10 OS update was pushed to my system (10.0.17763). I've tried reinstalling Git for Windows and Node, and neither have resolved the issue. I can't find any other settings that might be affecting this.
Using Git CMD or Windows CLI is a workaround, but neither of those have a "Git Bash Here" option, which is the #1 thing I want this for. It is also nice that I get the visual indication of branch in Git Bash where I do not get that with Git CMD or the Windows CLI.
I don't need or want to use Git GUI, and besides that won't allow me to run local node files which I need to do for testing.
Does anyone have any ideas on how I can get Git Bash working with node again?
UPDATE: By running stty -a after node fails, I see that echo has flipped to -echo, which is why I can't see the input anymore. But that doesn't explain why node isn't loading and echo is getting turned off. Hoping that gives someone some additional context to figure out what's going on here. brkint, icrnl, ixon, opost, isig, and icanon are also getting flipped to the - versions after attempting to run node.
There are 2 possible workarounds (based on what your problem is) that I have tried-
Enter node first of all:
1) Try typing in reset and hit enter. You may not be able to see the input logging in, in the bash terminal window, but it works after that.
2) Or try typing any random alphabet and hit enter(again you won't see it on the screen),it will throw a 'command not found' error but you will have node working after this.
I am afraid these aren't exactly proper fixes, but they get the job done.
More information can be found here: https://askubuntu.com/questions/171449/shell-does-not-show-typed-in-commands-reset-works-but-what-happened/172747#172747

Can't run heroku or vagrant in cygwin, but OK in cmd

Somehow, I can't run vagrant or heroku in cygwin. It works fine when I'm using the default windows cmd application, but in cygwin, I get this error for vagrant:
C:/vagrant/vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find vagrant (>= 0) amongst [] (Gem::LoadError) from C:/vagrant/vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:into_spec' from C:/vagrant/vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in gem' from C:/vagrant/vagrant/embedded/gems/bin/vagrant:22:in'
And for heroku:
C:\Program Files (x86)\ruby-1.9.2\bin\ruby.exe: No such file or directory -- /cygdrive/c/Program Files (x86)/Heroku/bin/heroku (LoadError)
What is this thing about ruby? I have no idea what I should be doing - developing in windows is a real pain, can anyone provide any insight into how I might solve this problem?
Appreciate any help. Thanks!
I ran in the same problem using Rails and Heroku on Windows.
It seems that the Toolbelt is not supported under Cygwin. Moreover colors are not always rendered in the right way (for example, I did not manage to render heroku logs colors, even after using ansicon -i).
I also considered using the CMD Prompt augmented with GOW but that means you have to append ".bat" to every command, and colors are still a problem.
I ended up using the Git Bash shell that is included with the RailsInstaller package.
It recongnizes all paths to relevant files, it has all the shell commands you need, and every color seems to be rendered correctly (e.g. rails logs, cucumber and rspec tests, heroku logs, etc.).
You've probably solved your issue a long time ago but I just wanted to add the steps I went through as I had the same issue on Windows with Cygwin.
Firstly always try to do an update of your Cygwin installation especially when you see an error similar to the one you've posted (I had the same error):
/ruby: No such file or directoryin/heroku: line 4: /cygdrive/d/Development/Heroku/ruby-1.9.2/bin
So I updated Cygwin and made sure to select all necessary ruby packages/interpreters etc, but this still didn't solve the problem as I kept getting the same error message.
Then I followed the steps outlined in Running the Heroku Command-Line Client Under Cygwin:
(1) Download RubyGem 1.9.3 from
http://rubyforge.org/frs/download.php/76072/rubygems-1.8.24.zip
(2) Then run the following -
$ unzip rubygems-1.8.24.zip
$ cd rubygems-1.8.24/rubygems-1.8.24
$ ruby setup.rb install
$ gem update --system
$ gem install heroku
(3) Open a new shell window and verify the version -
$ heroku version
heroku-gem/2.28.10 (i386-cygwin) ruby/1.8.7
This solved my problem and I can now run heroku commands from the Cygwin shell on Windows.
For me #Azkuma's answer only got me half the way. What worked for me:
1) Download and extract RubyGem zip: https://rubygems.org/pages/download
2) Set aliases to gem and heroku
alias gem='C:/ruby/bin/gem'
alias heroku='"C:/Program Files (x86)/Heroku/bin/heroku.bat"'
3) install as above
ruby setup.rb install
gem update --system
gem install heroku
4) login to heroku
heroku login
I found simply setting an alias worked for me.
alias heroku=c:/Program\\\ Files\\\ \\\(x86\\\)/Heroku/bin/heroku.bat
Then I can just use the heroku command directly with Cygwin.
The only thing I have a problem with is heroku login (and by extension, git push heroku master) whereby I'm prompted to use cmd.exe. For that part, I just open my Git Bash window from within the relevant folder, login and push from there.

Permission denied error while installing gitlab-ci

While installing gitlab ci (continues integration) on ubuntu (12.04LTS) i get the following error in step 5 (Setup application)
from: https://github.com/gitlabhq/gitlab-ci/blob/master/doc/installation.md
root#s2:~# cd /home/gitlab_ci/gitlab-ci/
root#s2:/home/gitlab_ci/gitlab-ci# sudo -u gitlab_ci -H gem install bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/local/lib/ruby/gems/1.9.1 directory.
It seems these gems try to install outside /home/gitlab_ci which indeed would fail as user gitlab_ci
My question is - are these instructions wrong? - or - am i an edge case.
And offcourse how would I safely solve this problem, just running the command as root might give me more trouble later on...
Extra information, Ruby was originally installed for gitlab itself and that works fine.
Considering that gitlab installation step 2 proposes to recompile ruby, I usually compile it with a --prefix=/home/gitlab/ruby1.9.3 argument, in order to use a ruby in which I have full rights to write/add any gem I want without using sudo.
So the $PATH used by the gitlab_ci account should include /home/gitlab/ruby1.9.3/bin and any gem installed by that account would go into the local compiled ruby.
If both accounts are part of the same group, they should both be able to write into /home/gitlab/ruby1.9.3/lib/ruby/gems/1.9.1.

Installing gitorious issue

I am struggling with the installation of gitorious (on an Ubuntu 12.04 distribution) on my local server following this tutorial : http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_server
After fixing some some config, I went running this command : env RAILS_ENV=production /etc/init.d/git-daemon start, I keep on having this message Starting git-daemon: FAILURE!!!, without finding any log message. After googling, I found it could be a config problem in the /etc/init.d/git-daemon config file : I put it here
Hmm... Can't say I can pinpoint the problem. Can you get any messages out of dmesg | tail?
I remember having some problems with the git-daemon, and I think they boiled down to some problem with ActiveMQ. Unfortunately, I can't remember how I fixed it.
There also seems to be a pretty neat, concise install script that streamlines the setup process for Ubuntu 12.04: https://gist.github.com/4236547
PS: You might want to get an account on pastebin to make your config file more easily accessible.

Resources