Git problems, 'git not installed' - ruby-on-rails

I have set up my github account, configured it with SSH and now I am trying to retrieve group work from gitlab. I have managed to pull the work so that it is on my machine but when I go to bundle install I encounter an error.
It says that I need to install git in order to gems from git repository.
I've added an image which might help.

Check if Git is installed in a folder with spaces or special character.
Try and unzip a recent Git (like PortableGit-2.3.7.1-dev-preview-64-bit.7z.exe) under C:\Git, and add that to your PATH:
set PATH=C:\Git\cmd;%PATH%
bundle install
The PATH issue was mentioned before in issue 5027 and in "Can't run bundle update on Windows".

Related

git: fatal: detected dubious ownership

I work with a new Windows installation and the same folder on my network share (NAS System).
After installing git and tortoisegit I tried to connect to the git repository, but I always get this error. What has changed is the server and not the user.
I have run
git config --global --add safe.directory '*'
But that changes nothing.
How can I fix this?
Where can I set the variable
GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true
This happens when a repo was cloned by a different user than your current user. In my case, I've encountered this issue after reinstalling windows, but using previously cloned git repositories (on a separate partition).
Right-click repo folder, properties, security, advanced.
Click "Change" on the Owner line.
Find your user (advanced..., find now, select your user). Confirm.
On the change screen, enable "Replace owner on subcontainers and objects".
That should fix the error.
If you intend to use more than one user on a cloned repo, then I'd follow git instructions to add the exception.

Add local repo for existing Xcode 5 Project

I've running through a Xcode 5 tutorial and want to make some significant changes, but want to make this Xcode 5 project into a repository.
I've done some reading and you can add a repository by going to Xcode -> Preferences -> Accounts -> Add Respository -> Enter the repository address:
So what would I input here for a local repository (on my iMac) I'm wanting to work on?
Cheers.
I would do this from the command line.
Close Xcode.app
Open Terminal.app
$ cd /path/to/project/dir
$ git init .
Create a .gitignore file to ignore some of the Xcode and output files that you don't want tracked (see below).
$ git add .gitignore
$ git add .
$ git commit -a -m Initial.
Sample (but incomplete) .gitignore file:
build/
*/xcuserdata/
And most likely you'll want to add a remote tracking repo, perhaps on github or bitbucket (once a bare repo has been created there):
$ git remote add origin https://bitbucket.org/yourname/yourrepo.git
$ git push -u origin --all
$ git push -u origin --tags
When you open the Xcode project next time it will be ready for Source Code use.
Apple's official solution is here.
See "Use Git to Manage an Unmanaged Workspace Directory on a Development Mac"
That's only for already existing repos that are stored somewhere outside of your project directory. You can create a new repo by opening the terminal in the top-level folder of your project, and then typing git init. Your repo is now created and will automatically be recognized by Xcode.

Beginner RoR Git config --global user name error

I am having trouble setting a global user name for git. When I type in git config --global user.name, I get the following error: "fatal: unable to access 'H:/.config/git/config': Invalid argument"
I have created a github account and thought I had made a repository for the project I'm working on, but I am not really sure if I did it right (or if this is related to the issue I am having). Also I get the same error, when I type in git init or git config.
Thanks for any help in advance. If possible, please be detaied as I am learning through tutorials right now. I do have git successfull installed (when I type in git -v I get a version number and ruby and rails are ok as well).
Getting Started with a new Github Account ->
1.) Create a Github Account (You probably done this)
2.) Navigate to your App's Folder (cd yourfoldername), you must be in your App's folder to configure git Properties.
$ git config --global user.name "Your Name" # Set your Git name
$ git config --global user.email youremail#gmail.com # Set your Git email
3.) Follow these Steps
$ git init # Set up Git on your project
$ git status # See tracked, untracked, and staged files
$ git add . # Add new files to Git
$ git commit -am "Initial commit" # Save your project files to Git
4.) Your App is now under Version Controll, now you must Generate your SSH Key.
-> Generating SSH Keys
If you are on Windows you can just download the Github Application, it will save you a lot of this Manual Setup. But setting up SSH Key's is not so difficult. Just follow the Guide.
5.) Then, you create a New Repository on Github, and it tells you on Page to enter this 2 lines. Youre Done :)
$ git remote add origin git#github.com/yourusername/yourreponame.git # Set up git to push to your Github repository
$ git push -u origin master # Push your code to Github (sets the upstream the first time)
Hope this Helps.
P.S.: I started learning Rails a few weeks ago -> Check this class on skillshare out -> One Month Rails: Learn to Code !!
Are you also providing your user name as an argument? It should be git config --global user.name "User Name". Just checking since you didn't mention that in your question.

How do i install rails application from github

Hi i have my application source code on github, now i want to upload it to my server. Should i first run rails new blog and then do a git init and git pull? Or do i have to create a folder manually, do a git pull to it and no need for rails new blog command?
first you want to git clone that repo from git hub
git clone blaa#github.com/blaa
once you get a folder created, go there and try doing
bundle
once that's done and once your dependencies are resolved, you can start the server
rails server

How to update rails plugins installed through git but in a svn repo?

My rails app is in a svn repository, but several of the plugins are installed through git and later added to the svn repo. How can I update these plugins? I can't seem to get script/plugin update to do anything. I'd really like to update activemerchant to get rid of the Inflector warnings.
If you haven't made any local changes to the plugin and you don't need to track what changes to it the update will bring, you can just run script/plugin install again, passing in --force if you need to. For example:
script/plugin install --force git://github.com/dchelimsky/rspec.git
If you already have a static copy of a plugin checked into Subversion, it can be a pain to update it via script/plugin, so here's what I end up doing in order to switch it from a static install to a Git checkout all within one Subversion commit:
git clone git://github.com/foo/bar.git ~/foobar
mv ~/foobar/.git rails_app/vendor/plugins/foobar/.git
rm -rf ~/foobar
cd rails_app/vendor/plugins
git reset --hard
Then make sure to add .git and everything else that has changed to the Subversion project and you will be all up-to-date. You can use other git commands to pull down updates, move to a different branch, etc. Then just check things in again once they are at the state that you want.
One thing I do in this case, I remove the plugin directory then I commit to SVN, this will remove the old plugin in the repo. (I usually moved it in a tmp directory, just in case and delate it later once the new one is working fine)
I then reinstall the new version of the plugin, and commit again.
Easy.
You should just be able to navigate to the plugin's directory and hit:
git pull
. I'm pretty sure that script/install plugin just checks the code out from the git repo.
In order for Git to be able to recognise the repository as a Git repository, you will need to add the .git subdirectory and everything under it to Subversion as well. Otherwise, the plugin will just look like another pile of source code and Git will say it's "Not a Git repository".
Ran into the same situation and used this solution: had paperclip installed as a plugin sitting in an svn repo as part of my app. Now I wanted to use the latest version instead and didnt change a bit of the paperclip plugin so I could easyly remove it from the app/svn and install it as a gem instead. done.

Resources