trycatchblock said:
https://github.com/p2pu-intro-ruby/coursework
&
https://github.com/dublinan/coursework
leads to a 404. What happened here?
This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.
For this course, GitHub is used as a central repository for exercise submissions. Each course participant will create an account on GitHub, fork (i.e., copy) the course repository, modify the skeleton files to complete assignments, and push the completed work back up to GitHub for all to see and review.
git is a distributed version control system. Version control systems are an important toolkit in a developer's arsenal: they allow developers to track changes to their code over time and operate well in a team. Developers usually commit small changes as they complete features, creating revisions that are archived and never lost.
git is the most popular version control system used with Ruby at this time.
git does not have the gentlest learning curve, but the basic functions are pretty straightforward and well documented.
Reading Assignment: Learn more about git by reading Pro Git - Git Basics.
Task: Sign up for a free account on GitHub.
Reading Assignment: After you've learned about git at a high level, setup git on your local machine by following the instructions on GitHub for your platform. Follow the entire guide, including setting up SSH keys.
Alternatives to installing GIt:
Its great that technology makes life eaiser for us, but its better to know how the internals of a system works. For those less adventurous here are some other ways of interacting with git and github.
Windows: http://windows.github.com/
Mac: http://mac.github.com/
Reading Assignment: Read the GitHub guide to forking a repository.
Task: Fork the coursework repository. Specifically, follow along with this screencast.
https://github.com/p2pu-intro-ruby/coursework
&
https://github.com/dublinan/coursework
leads to a 404. What happened here?
sorry about that I updated the link
I'm hoping I have done this all correctly. https://github.com/davidodowd/coursework
Thanks Andre. It might be worth adding steps about what http://windows.github.com/ does. Should people be using it or should they be learning by using the commands.
I'd like the course to introduce people to the command line, since ruby and rails both use it heavily. Also being comfortable in the command line gives people confidence in other areas of software development.
Thanks, I'll add it to the course materials.
I found dublinan/coursework repository empty. I don't get it.
What do you need assistance with?
It should only have a README file. It is meant to be copied and modified.
OK. I thought I find in the repository partly prepared exercises. Now I understand, I need to write them and then put into repository.
Looks good, if your using your own repo for the course that is fine
Hai,
I am a novice in this field.What is use of these repo in ruby?
I'm just having you all as students understand some basic git commands with this challenge, and understand basic parts of github.
The use of github repos will allow me to read over your work and provide help where needed. If that answers your question.
Ok, getting some time fianlly.
Git account setup.
One error on:
git remote add upstream git://github.com/octocat/LearnRuby.git
git fetch upstream
fatal: The remote end hung up unexpectedly
can you provide a link to your git account
https://Frankly3D@github.com/Frankly3D/LearnRuby.git
git://github.com/Frankly3D/LearnRuby.git
Ok, here is how you will copy your repo localy
$ git clone git@github.com:Frankly3D/LearnRuby.git
You won't have to set up a remote because cloning, automatically creates it. Then all you have to do is follow this workflow
$ git add <fllename>
or
$ git add .
. is all files that have been changed/added to the repo
$ git commit -m "your message here" $ git push origin master
You won't have to worry about using upstream, upstream is used when say your working from two different machines, or you have collaboraters on a project and there are changes to the remote repo git fetch upstream will pull in those changes for you without merging.
All steps went ok, git account is set up. I followed the github page tutorial. (mac lion)
I'm having some problems cloning. See below. Any ideas on what I'm doing wrong?
Peters-MacBook-Air:~ hwangpet$ git clone git@github.com:hwangpet/coursework.git
Cloning into 'coursework'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
The error seems to be telling you that github can't find your public keys:
So try this: http://help.github.com/mac-set-up-git/
If this is the only identity you have (i.e. only one github account) you can simply follow along. If you have something more involved we might need to talk about your ssh setup.
Shoot a message when you have worked through those steps (you only have to do it once)...unless this happens again.
Denis
Thanks. Now I'm stuck on step 3.
Peters-MacBook-Air:.ssh hwangpet$ ssh-keygen -t rsa -C "hwangpet@gmail.com"
-bash: ssh-keygen: command not found
Did you run this command at your prompt?
ssh-keygen -t rsa -C "your_email@youremail.com"
Just want to make sure your didn't put any extra words/characters in there
Also it seems your running Lion OS X
run echo $PATH in terminal and let me know the response.
Andre,
Thanks for reply. See below:
Peters-MacBook-Air:.ssh hwangpet$ ssh-keygen -t rsa -C "hwangpet@gmail.com"
-bash: ssh-keygen: command not found
Peters-MacBook-Air:.ssh hwangpet$ echo $PATH
/usr/local/git/bin:/bin:/usr/local/bin:/bin:/usr/local/bin
I think that you may have to install Xcode to obtain developer tools such as ssh. Or you can roll your own and install openssh. However I recommend install Xcode.
Installed xcode - still get the same errors. Any other ideas?
Hi Peter,
Did you install xCode 4? I am not a Mac user, but this thread seems to be relevant: http://stackoverflow.com/questions/5364340/does-xcode-4-install-git.
Perhaps since xCode appears to install git it simply can't find the path you can tell it to like this post suggest: http://stackoverflow.com/questions/5545715/how-do-i-add-usr-local-git-bin-to-the-path-on-mac-osx
Keep plugging away man!
Peter, check it: http://bit.ly/zyDoRQ It may help with the ssh problem
Hey Peter,
Can you echo your $PATH again now that Xcode is installed?
I'm hunting an answer for you.
Andre,
Here the result after running echo $PATH in terminal:
wifi-dhcp-55-168:~ hwangpet$ echo $PATH
/usr/local/git/bin
Thanks again for all the help fellas! I'm going to work with one of my developers today who already use github so hopefully they can point me in the right direction.
It looks like your missing some necessary binarys in your PATH variable
these basic path settings should be in your .bash_profile like so
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH
Not sure where your Xcode is, but your developers should understand the situation
Andre - you were correct. My .bash_profile was corrupted. My echo $PATH looks normal now:
wifi-dhcp-55-168:Users hwangpet$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/git/bin
Thanks alot everyone!
I think you might be right about requiring git before you install rvm, but i believe you usually use curl to install...
This one is a bit tricky with all the diferent steps between installing git, setting up the account and the ssh keys so that the installed Git on your machine can talk to your Github account.
From what I can remember, to install RVM it also requires you to have Git installed on your machine for some reason. This might help poeple having trouble installing RVM.
Hey guys,
I'm glad Peter is up and running. I remember having allot of the same issues trying to the different bits a pieces put together myself. I see that Peter has in his bash_profile:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/git/bin
I was wondering how does this actaully work? My understanding so far is that when you call a program to perform an action in the command line, for example "rails server", "mysql -u root" or "git init", the comand line looks for the named program in the directories mentioned in the bash_profile file. Am I right? Could someone clarify?
Again, another aussumption is that, for programs to talk to each other on a host they need to know where each other exist on the hard disk. If I have a rails app that needs to resize an image, how does the rails app know where ImageMagick is? Do the diferent applications use the bash_profile as a directory to find each other?
Also, How does the syntax of the bash_profile files or shell script work interms of tying libraries and applications together?
Where does RubyGems and Bundler fit into this whole thing?
Obviously this kind of stuff plays an important part in your development enviornment but it's plays a massive role in delievering code. Interms of depoying ruby applications to the web it's important to have a solid handle on how to setup Linux boxes. It would be great to get pointers to goood resourses on more learning for this kind of stuff.
Hey Mark, excellent question!
The string you see when you use echo $PATH in terminal is a result of a UNIX variable. It tells terminal where to find the binarys necessary to execute programs the " : " is a delimiter that lets you specify multiple paths to where your binaries are located in the file system.
How Ruby knows where to find stuff because when ruby is built for your particular machine, it has predefined directories to hold libraries. Where these reside all depends on the machine you are using. So an Ubuntu OS Ruby location may be different from a Windows OS Ruby location, or when you install RVM the Ruby location is different and so on.
If you run this command in terminal
ruby -e 'puts $:'
You will receive an output of the directories that Ruby is using.
$: is a Ruby array variable of places to search for loaded files.
As for Rubygems, it is a standardized packging and installation framework for Ruby libraries and apps. Thus making it easier to install, upgrade, and locate Ruby packages. Keeping lots of Ruby developers including myself sane.
Rubygems handles all the dependencies, and version control of gems to install on your system.
Bundler is sort of an extension for Rubygems in Ruby applications, using Gemfiles to install and locate gems necessary for your application.
I hope this answers your question, here are some links below to help you further understand.