Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build gem from source #116

Closed
matellis opened this issue Dec 20, 2010 · 9 comments
Closed

Unable to build gem from source #116

matellis opened this issue Dec 20, 2010 · 9 comments

Comments

@matellis
Copy link
Contributor

~> git clone https://github.com/geemus/fog.git
~> cd fog
~/fog> gem build fog.gemspec
ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    ["spec/compact_progress_bar_formatter.rb", "spec/core/attributes_spec.rb", "spec/lorem.txt"] are not files

If I create these folders & files I can build the Gem but then I get:

ruby-1.9.2-p0 > require 'fog'
LoadError: no such file to load -- fog/core/mock
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /Users/jdoe/.rvm/gems/ruby-1.9.2-p0/gems/fog-0.3.32/lib/fog/core.rb:26:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /Users/jdoe/.rvm/gems/ruby-1.9.2-p0/gems/fog-0.3.32/lib/fog.rb:1:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:33:in `require'
    from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from (irb):1
    from /Users/jdoe/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'

When I comment out line 26 in lib/fog/core.rb I get a second error, basically the same warning but for 'fog/core/wait_for'

Sorry if I'm filing bugs on an incomplete check-in, I got the impression from some of the AWS blogs and the examples that the gem usable for Route53.

@mitchellh
Copy link
Contributor

Hm. Wes, I think I mentioned this to you before I'm not sure. I think you should switch the gemspec to use a more modern style. See Vagrant's here: https://github.com/mitchellh/vagrant/blob/master/vagrant.gemspec

This way, the gemspec is always up-to-date with what is currently in git, and issues like this are avoided.

@matellis
Copy link
Contributor Author

You mean something like this?

require File.expand_path("../lib/fog/version", __FILE__)

Gem::Specification.new do |s|
  s.name          = "fog"
  s.version       = Fog::VERSION
  s.platform      = Gem::Platform::RUBY
  s.authors       = ["geemus (Wesley Beary)"]
  s.email         = 'geemus@gmail.com'
  s.homepage      = 'http://github.com/geemus/fog'
  s.summary       = "Brings clouds to you."
  s.description   = "The Ruby cloud computing library."

  s.required_rubygems_version = ">= 1.3.6"
  s.rubyforge_project         = "fog"

  s.add_dependency('builder')
  s.add_dependency('excon', '>=0.3.3')
  s.add_dependency('formatador', '>=0.0.16')
  s.add_dependency('json')
  s.add_dependency('mime-types')
  s.add_dependency('net-ssh', '>=2.0.23')
  s.add_dependency('nokogiri', '>=1.4.4')
  s.add_dependency('ruby-hmac')

  s.add_development_dependency('rake')
  s.add_development_dependency('rspec', '1.3.1')
  s.add_development_dependency('shindo', '0.1.10')

  s.files         = `git ls-files`.split("\n")
  s.test_files = s.files.select { |path| path =~ /^[spec|tests]\/.*_[spec|tests]\.rb/ }
  s.executables   = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
  s.default_executable = 'fog'
  s.require_paths = %w[lib]

  s.rdoc_options = ["--charset=UTF-8"]
  s.extra_rdoc_files = %w[README.rdoc]
end

@mitchellh
Copy link
Contributor

Yeah something like that. I tried to do it myself a few months ago but there are a lot of things in the Rakefile for building the gemspec and all that and I'm not quite sure what Wes's (geemus) thoughts on all of this is.

Will await his comments

@matellis
Copy link
Contributor Author

Which is why I didn't bother to fork and pull request. Let's see what Wes has to say.

@matellis
Copy link
Contributor Author

The gemspec above works nicely with just one addition, namely moving the version definition from lib/fog/core.rb to lib/fog/version.rb I think I'll whip up a quick fork & pull request for Wes, it seems to work just fine.

@geemus
Copy link
Member

geemus commented Dec 21, 2010

In my defense I think you can build the gem from source using rake. You just change the version and then I believe rake build will give you what you want (including updating the list of files and version, as long as you have bumped it in lib/fog). That is the workflow that I have been using and seems pretty good. I certainly see the value of not necessarily relying on this since others may not know to do this, but I also like my current workflow. I'm hoping to release a bit later today anyway, but I'll try to review the proposed patch and get that sorted out before I release (I'm leaning toward a solution that is maybe halfway in between, so that you don't have to know about the rake stuff, but so that my workflow is more or less the same).

@geemus
Copy link
Member

geemus commented Dec 21, 2010

[gemspec] fix file list, now buildable from source

closed by ec6e901

@matellis
Copy link
Contributor Author

Sorry geemus, I didn't know about the rake task and am not much of an expert on gems in general. I belong to the school of methodical trial & error with Google results! ;-) Thanks

@geemus
Copy link
Member

geemus commented Dec 21, 2010

No worries. Its good for me to know, since I had a way that worked but didn't realize other people wanted to build it from source (and by extension that building was non-obvious). Hopefully we can all be happy and on the same page now. Running through test suites now and will hopefully get all this released pretty soon (thereby at least temporarily reducing the need for building your own anyway).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants