Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Error when build gem with exe/command on bundler 1.8.0 #3392

Closed
sanemat opened this issue Feb 12, 2015 · 3 comments
Closed

Error when build gem with exe/command on bundler 1.8.0 #3392

sanemat opened this issue Feb 12, 2015 · 3 comments
Assignees

Comments

@sanemat
Copy link
Contributor

sanemat commented Feb 12, 2015

I try to use exe/command, but I met error when I was building gem.

$ bundle gem your-task -b
Creating gem 'your-task'...
      create  your-task/Gemfile
      create  your-task/.gitignore
      create  your-task/lib/your/task.rb
      create  your-task/lib/your/task/version.rb
      create  your-task/your-task.gemspec
      create  your-task/Rakefile
      create  your-task/README.md
      create  your-task/bin/console
      create  your-task/bin/setup
      create  your-task/CODE_OF_CONDUCT.md
      create  your-task/LICENSE.txt
      create  your-task/.travis.yml
      create  your-task/.rspec
      create  your-task/spec/spec_helper.rb
      create  your-task/spec/your/task_spec.rb
      create  your-task/exe/your-task
Initializing git repo in /Users/sane/work/tmp/your-task
$ cd your-task/
$ git commit -m 'initial commit'
$ bundle exec rake build --trace
** Invoke build (first_time)
** Execute build
rake aborted!
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    ["bin/your-task"] are not files
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.0/lib/bundler/gem_hel
per.rb:155:in `sh'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.0/lib/bundler/gem_hel
per.rb:70:in `build_gem'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.0/lib/bundler/gem_hel
per.rb:39:in `block in install'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/task.rb:240:
in `call'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/task.rb:240:
in `block in execute'  
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/task.rb:235:
in `each'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/task.rb:235:
in `execute'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/bin/rake:23:in `load'
/Users/sane/.anyenv/envs/rbenv/versions/2.2.0/bin/rake:23:in `<main>'
Tasks: TOP => build

my env:

$ bundle env
Environment

    Bundler   1.8.0
    Rubygems  2.4.5
    Ruby      2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13]
    Git       2.2.1

Bundler settings

    gem.coc
      Set for the current user (/Users/sane/.bundle/config): "true"
    gem.mit
      Set for the current user (/Users/sane/.bundle/config): "true"
    gem.test
      Set for the current user (/Users/sane/.bundle/config): "rspec"

Gemfile

    source 'https://rubygems.org'

    # Specify your gem's dependencies in your-task.gemspec
    gemspec

Gemfile.lock

    PATH
      remote: .
      specs:
        your-task (0.1.0)

    GEM
      remote: https://rubygems.org/
      specs:
        rake (10.4.2)  

    PLATFORMS
      ruby

    DEPENDENCIES
      bundler (~> 1.8) 
      rake (~> 10.0)   
      your-task!
@TimMoore
Copy link
Contributor

Yep, you found a bug in the template.

To fix your gem, you need to add spec.bindir = 'exe' to your gemspec and run chmod +x exe/* in the shell.

Thanks for the report!

@TimMoore
Copy link
Contributor

There's a fix at #3395.

@TimMoore
Copy link
Contributor

Fixed in 1.8.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants