从git branch构建gem时出错

时间:2011-11-17 16:32:37

标签: ruby-on-rails-3 git gem

我按照this question的说明从git安装gem。

当我尝试时,我会检查我得到的分支:

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

我还尝试these instructions下载分支,工作正常。但我仍然无法建立宝石。我明白了:

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>'

我也试过了rake gem,但我得到了同样的错误。我该怎么办?

我正在使用rails 3和ruby 1.9.2

2 个答案:

答案 0 :(得分:0)

可能你已经有了rails3分支。用git branch检查一下。 如果分支已经存在,请尝试运行不带'-b'的相同命令。它应该工作。

答案 1 :(得分:0)

我按照以下说明中的建议运行gem build apn_on_rails.gemspec而不是rake buildrake gem来解决问题