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

Not Finding bundler gem in build? #11

Closed
ddoherty03 opened this issue Jul 22, 2017 · 12 comments
Closed

Not Finding bundler gem in build? #11

ddoherty03 opened this issue Jul 22, 2017 · 12 comments

Comments

@ddoherty03
Copy link

In trying to compile cli gem I am working on with:

rubyc bin/byr

I get the following error at the end:

-> Running [{"CI"=>"true", "PATH"=>"/tmp/rubyc/ruby/build/bin:/home/ded/.rbenv/shims:/home/ded/.rbenv/bin:/home/ded/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ded/.cask/bin:/home/ded/go/bin", "GEM_HOME"=>nil, "GEM_PATH"=>nil, "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "sh", "-c", "gem install /__enclose_io_memfs__/local/vendor/bundler-1.15.1.gem --force --local --no-rdoc --no-ri"]
ERROR:  Could not find a valid gem '/__enclose_io_memfs__/local/vendor/bundler-1.15.1.gem' (>= 0) in any repository
Failed running [{"CI"=>"true", "PATH"=>"/tmp/rubyc/ruby/build/bin:/home/ded/.rbenv/shims:/home/ded/.rbenv/bin:/home/ded/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ded/.cask/bin:/home/ded/go/bin", "GEM_HOME"=>nil, "GEM_PATH"=>nil, "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "sh", "-c", "gem install /__enclose_io_memfs__/local/vendor/bundler-1.15.1.gem --force --local --no-rdoc --no-ri"]

It looks like it is trying to install the bundler gem from a local source but not finding it. Also seems to specify a root path /enclose_io_memfs ...

Am I missing something obvious here, or is this a bug?

@pmq20
Copy link
Owner

pmq20 commented Jul 27, 2017

Could you share the code of bin/byr so that I can reproduce it locally? Otherwise I will try a random CLI gem project with Gemfile to see if I can reproduce it. Thanks!

@pmq20
Copy link
Owner

pmq20 commented Jul 28, 2017

@ddoherty03 never mind. Should be my fault. There is another similarly reported issue . Let me fix it ASAP.

#12 (comment)

@pmq20
Copy link
Owner

pmq20 commented Jul 28, 2017

@ddoherty03 Weird. I failed to reproduce it locally in the latest master branch (i.e. 0.4.0). Which version of rubyc are you using?

@ddoherty03
Copy link
Author

@pmq20, I tried to get the version with rubyc --version, but it updated the version when I got that to 0.3.3.

Anyway, I tried again and go the same error:

-> Running [{"CI"=>"true", "PATH"=>"/tmp/rubyc/ruby-2.4.1-.3.0/build/bin:/home/ded/.rbenv/shims:/home/ded/.rbenv/bin:/home/ded/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ded/.cask/bin:/home/ded/go/bin", "GEM_HOME"=>nil, "GEM_PATH"=>nil, "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "sh", "-c", "gem install /__enclose_io_memfs__/local/vendor/bundler-1.15.2.gem --force --local --no-rdoc --no-ri"]
ERROR:  Could not find a valid gem '/__enclose_io_memfs__/local/vendor/bundler-1.15.2.gem' (>= 0) in any repository
Failed running [{"CI"=>"true", "PATH"=>"/tmp/rubyc/ruby-2.4.1-.3.0/build/bin:/home/ded/.rbenv/shims:/home/ded/.rbenv/bin:/home/ded/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ded/.cask/bin:/home/ded/go/bin", "GEM_HOME"=>nil, "GEM_PATH"=>nil, "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "sh", "-c", "gem install /__enclose_io_memfs__/local/vendor/bundler-1.15.2.gem --force --local --no-rdoc --no-ri"]

Here is the text of bin/byr:

#! /usr/bin/env ruby
# -*- coding: utf-8 -*-
# -*- mode: ruby -*-

require 'byr'

module Byr
  if ['-l', '--ledger'].include?(ARGV[0])
    ARGV.shift
    ledger_name = ARGV.shift
  elsif ['-v', '--version'].include?(ARGV[0])
    puts Byr::VERSION
    exit(0)
  end

  command_name = ARGV.shift || 'shell'
  init unless command_name == 'init'
  set_current_ledger(ledger_name) if ledger_name

  command = Command.get(command_name)
  unless command
    raise UserError, "unknown command #{command_name}"
  end
  exit(command.run(ARGV, from_shell: false))

rescue => exception
  case exception
  when UserError
    oops "Error: #{exception.message}"
  else
    # Byr::LogicError, Byr::TransientError, and others
    oops "Logic Error: #{exception}"
    exception.backtrace.each do |ln|
      oops ln
    end
  end
  exit(1)
end

Is there anything else that would help you diagnose this?

@pmq20
Copy link
Owner

pmq20 commented Jul 31, 2017

@ddoherty03 I figured it out. gem cannot read a virtual path. The reason why it works from the master repo is that it is reading a real path. When running from stand-alone nodec or nodec.exe, it is a virtual path.

@pmq20
Copy link
Owner

pmq20 commented Jul 31, 2017

Fixed in a84edb6

I'll release it in rubyc v0.4.0 as soon as possible.

@ddoherty03
Copy link
Author

Good work, @pmq20. I'll try it out when I get some time.

@SwagDevOps
Copy link
Contributor

SwagDevOps commented Aug 2, 2017

So impatient for rubyc v0.4.0… so bored to compile rubyc from sources (but it works).

@ddoherty03
Copy link
Author

@SwagDevOps. are you saying you have v0.4.0? I don't see it yet.

@SwagDevOps
Copy link
Contributor

SwagDevOps commented Aug 2, 2017

Absolutely… as previously said, bug is fixed since 3 days… but, atm, you have to compile rubyc from sources yourself (or wait for a release).

# rubyc --version
0.4.0
# rubyc --help | head -2
Ruby Compiler (rubyc) v0.4.0
Compiling your Ruby application into a single executable.

@pmq20
Copy link
Owner

pmq20 commented Aug 14, 2017

@ddoherty03 @SwagDevOps Ruby Compiler v0.4.0 released! Download: http://enclose.io/rubyc

@drbrain
Copy link
Collaborator

drbrain commented May 9, 2018

Closing due to lack of feedback

@drbrain drbrain closed this as completed May 9, 2018
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

4 participants