0

I am following the instructions of this question to install a gem from git.

When I try to do I checkout of the branch I get:

mari@Black:~/Documents/apn_on_rails$ git checkout -b rails3 remotes/origin/rails3
fatal: git checkout: branch rails3 already exists

I also tried these instructions to download the branch and that works fine. But I still cannot build the gem. I get:

mari@Black:~/Documents/apn_on_rails$ rake build --trace
rake aborted!
no such file to load -- gemstub
/home/mari/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/mari/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/mari/Documents/apn_on_rails/Rakefile:2:in `<top (required)>'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'

I also tried rake gem but I get the same error. What can I do?

I am using rails 3 and ruby 1.9.2

Community
  • 1
  • 1
marimaf
  • 5,382
  • 3
  • 50
  • 68

2 Answers2

0

possibly you already have rails3 branch. Check this with git branch. If branch already exist try running same command without '-b'. It should work.

Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
  • This is what I got:mari@Black:~/Documents/apn_on_rails$ git checkout rails3 remotes/origin/rails3 error: pathspec 'remotes/origin/rails3' did not match any file(s) known to git. ANd I also tried it like this mari@Black:~/Documents/apn_on_rails$ git checkout rails3 Already on 'rails3' – marimaf Nov 17 '11 at 16:58
0

I fixed the problem by running gem build apn_on_rails.gemspec instead of rake build or rake gem as suggested in the instructions followed

marimaf
  • 5,382
  • 3
  • 50
  • 68