Search code examples
ruby-on-railsgitgit-pushgemfilecloud9

Cloud9 - Git - Rails App (Error on bash after Gemfiles Changes)


I'm following a Rails tutorial for an app development and after making some Gemfile Changes, I receive two errors when trying to push the changes to Github.

I started by branch off to a new branch of code using the git tool and I did that to make another version of the site. I did that with the following line in the terminal:

git checkout -b pages_and_layout

After that, I made all the changes I wanted on the gemfile. To save the changes I typied:

  1. thedude:~/workspace/xptoapp (pages_and_layouts) $ git status
  2. thedude:~/workspace/xptoapp (pages_and_layouts) $ git add .
  3. thedude:~/workspace/xptoapp (pages_and_layouts) $ git commit -m "blah blah blah"
  4. thedude:~/workspace/xptoapp (pages_and_layouts) $ git push origin pages_and_layout

The two errors I got were:

error: src refspec pages_and_layout does not match any.

error: failed to push some refs to 'git@github.com:thedude/xptoapp.git'

Any simple explanation and solution for the issue?

Cheers.


Solution

  • Problem solved, it was typo. My branch name was different from the branch named on the tutorial.

    I wrote:

    thedude:~/workspace/xptoapp (pages_and_layouts) $ git push origin pages_and_layout

    It should have been written:

    thedude:~/workspace/xptoapp (pages_and_layouts) $ git push origin pages_and_layouts