problem with rubygems and rake creating a new gem

M

Mario Ruiz

Hæ,
I've updated rubygems to the last version since it was necessary for
another library and now I cannot create the gem file for my framework.

What I have is a rakefile.rb:
require 'rubygems'
Gem::manage_gems

require 'rake/gempackagetask'

spec = Gem::Specification.new do |s|
s.platform = Gem::platform::RUBY
s.name = "BxWW"
s.version = "1.3.0"
s.author = "Mario Ruiz"
s.email = "(e-mail address removed)"
s.summary = "blabla blabla"
s.files = FileList['src/**/*'].to_a
s.require_path = "."
s.has_rdoc = true
end

Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
end

task :default => "build/#{spec.name}-#{spec.version}.gem" do
puts "generated latest version"
end


And then I run in command line: rake gem


It was working for me before but now this error is displayed: rake
aborted! undefined method 'manage_gems' for Gem::Module.
I was taking a look at google and I found out Gem::manage_gems is
unsupported now and should be changed for require 'rubygems/builder' but
then the error is: rake aborted! undefined method 'empty?' for
nil:NilClass

Any idea???

Thanks in advance. :)
 
E

Eric Hodel

I've updated rubygems to the last version since it was necessary for
another library and now I cannot create the gem file for my framework.

RubyGems 1.3.2 removed Gem::manage_gems:

http://rubyforge.org/forum/forum.php?forum_id=3166

It had been deprecated and was giving warnings for some time now.

Also, you should use Gem::packageTask instead of Rake's GemPackage task.
What I have is a rakefile.rb:
[...]

I've fixed it for you:

require 'rubygems'
require 'rubygems/packagetask'

spec = Gem::Specification.new do |s|
s.name = "BxWW"
s.version = "1.3.0"
s.author = "Mario Ruiz"
s.email = "(e-mail address removed)"
s.summary = "blabla blabla"
s.description = "FIX"
s.homepage = "FIX"
s.files = FileList['src/**/*'].to_a
s.require_path = "."
end

Gem::packageTask.new(spec) do |pkg|
pkg.need_tar = true
end

task :default => "build/#{spec.name}-#{spec.version}.gem" do
puts "generated latest version"
end
 
R

Ryan Davis

I've fixed it for you:

require 'rubygems'
require 'rubygems/packagetask'

spec = Gem::Specification.new do |s|
s.name = "BxWW"
s.version = "1.3.0"
s.author = "Mario Ruiz"
s.email = "(e-mail address removed)"
s.summary = "blabla blabla"
s.description = "FIX"
s.homepage = "FIX"
s.files = FileList['src/**/*'].to_a
s.require_path = "."
end

Gem::packageTask.new(spec) do |pkg|
pkg.need_tar = true
end

task :default => "build/#{spec.name}-#{spec.version}.gem" do
puts "generated latest version"
end

I've fixed it moar:

require 'rubygems'
require 'hoe'
require './lib/BxWW.rb'

Hoe.new('BxWW', BxWW::VERSION) do |bxww|
bxww.developer('Mario Ruiz', '(e-mail address removed)')
end
 
M

Mario Ruiz

Thanks Eric,

When I try your code...
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- rubygems/packagetask
(LoadError)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from rakefile.rb:2
 
M

Mario Ruiz

Sorry Ryan I don't understand what your are proposing, I don't have a
BxWW.rb file
 
R

Ryan Davis

Sorry Ryan I don't understand what your are proposing, I don't have a
BxWW.rb file

require 'rubygems'
require 'hoe'
require './lib/BxWW.rb'

Hoe.new('BxWW', BxWW::VERSION) do |bxww|
bxww.developer('Mario Ruiz', '(e-mail address removed)')
end

Luckily, that is just a string and easy for you to fix.

I also fixed your email so that full context was available again and
provided instructions for further mailing list correspondence:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top