2

所以我已经完成了 Gem install newgem (在 rvm 下运行)和 sudo gem install newgem 以防万一出现问题。当我尝试运行它时,我得到以下信息。我才刚刚开始使用 ruby​​,无法真正推断出它不起作用的原因。任何人都可以帮忙吗?

mikey@mikey-netbook:~/Projects/gems$ newgem somegem
NOTE: Gem.cache is deprecated, use Gem::source_index. It will be removed on or after 2011-08-01.
 Gem.cache called from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/rubigen-1.5.6/lib/rubigen/lookup.rb:284.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
 Gem.source_index called from /home/mikey/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1154.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/rubigen-1.5.6/lib/rubigen/lookup.rb:284.
/home/mikey/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rubyforge (>= 0) amongst [RedCloth-4.2.9, actionmailer-3.1.3, actionpack-3.1.3, activemodel-3.1.3, activerecord-3.1.3, activeresource-3.1.3, activesupport-3.1.3, activesupport-2.3.14, ansi-1.4.1, arel-2.2.1, bluecloth-2.2.0, builder-3.0.0, builder-2.1.2, bundler-1.0.21, bundler-1.0.21, chronic-0.6.6, coffee-rails-3.1.1, coffee-script-2.2.0, coffee-script-source-1.1.3, curb-0.7.16, erubis-2.7.0, execjs-1.2.12, execjs-1.2.9, feedzirra-0.1.1, hike-1.2.1, hoe-2.12.4, hpricot-0.8.5, httparty-0.8.1, i18n-0.6.0, jquery-rails-1.0.19, json-1.6.3, loofah-1.2.0, mail-2.3.0, markaby-0.7.2, mime-types-1.17.2, multi_json-1.0.4, multi_xml-0.4.1, net-ldap-0.2.2, net-ping-1.5.2, newgem-1.5.3, nokogiri-1.4.7, polyglot-0.3.3, rack-1.3.5, rack-cache-1.1, rack-mount-0.8.3, rack-ssl-1.3.2, rack-test-0.6.1, rails-3.1.3, railties-3.1.3, rake-0.9.2.2, rake-0.9.2, rdoc-3.11, rubigen-1.5.6, sass-3.1.11, sass-rails-3.1.5, sax-machine-0.1.0, simple-rss-1.2.3, sprockets-2.0.3, sqlite3-1.3.5, syntax-1.0.0, thor-0.14.6, tilt-1.3.3, treetop-1.4.10, turn-0.8.2, tzinfo-0.3.31, uglifier-1.1.0] (Gem::LoadError)
from /home/mikey/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /home/mikey/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/newgem-1.5.3/lib/newgem/rubyforge-ext.rb:5:in `rescue in <top (required)>'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/newgem-1.5.3/lib/newgem/rubyforge-ext.rb:1:in `<top (required)>'
from /home/mikey/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/mikey/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `block in require'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/newgem-1.5.3/app_generators/newgem/newgem_generator.rb:163:in `extract_options'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/newgem-1.5.3/app_generators/newgem/newgem_generator.rb:38:in `initialize'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/rubigen-1.5.6/lib/rubigen/lookup.rb:165:in `new'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/rubigen-1.5.6/lib/rubigen/lookup.rb:165:in `instance'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/rubigen-1.5.6/lib/rubigen/scripts.rb:32:in `run'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/gems/newgem-1.5.3/bin/newgem:28:in `<top (required)>'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/bin/newgem:19:in `load'
from /home/mikey/.rvm/gems/ruby-1.9.2-p290/bin/newgem:19:in `<main>'
4

1 回答 1

0

我假设您正在尝试创建一个新的宝石。在这种情况下,我会推荐捆绑器。有一些优秀的教程向您展示如何实现这一目标。我发布了一个教程 Railcast - New Gem with Bundler 的链接。就您的错误而言,我认为由于 newgem 有一段时间没有更新,它可能无法正常工作。

于 2011-12-16T22:29:44.020 回答