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

Cannot run installed "mono" gems (ie: fastlane) #40

Open
lkraider opened this issue Jan 17, 2017 · 6 comments
Open

Cannot run installed "mono" gems (ie: fastlane) #40

lkraider opened this issue Jan 17, 2017 · 6 comments

Comments

@lkraider
Copy link

Installing works:

brew gem install fastlane --homebrew-ruby
==> Fetching fastlane from gem source
Fetching: fastlane-2.9.0.gem (100%)
Downloaded fastlane-2.9.0
Warning: Cannot verify integrity of fastlane-2.9.0.gem
A checksum was not provided for this resource
For your reference the SHA256 is: 5dbede0e3f03daa846d3f075777632989aaabd267b3ea3be3ddf37a9dc7f9503
==> /usr/local/bin/gem install ~/Library/Caches/Homebrew/fastlane-2.9.0.gem --no-ri --no-rdoc --no-wrapper --n
🍺  /usr/local/Cellar/gem-fastlane/2.9.0: 4,004 files, 62.8M, built in 1 minute 25 seconds

But executing the binary fails:

$ fastlane init
/usr/local/Cellar/ruby/2.3.1_2/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- fastlane/cli_tools_distributor (LoadError)
	from /usr/local/Cellar/ruby/2.3.1_2/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/Cellar/gem-fastlane/2.9.0/gems/fastlane-2.9.0/bin/fastlane:4:in `<top (required)>'
	from /usr/local/bin/fastlane:5:in `load'
	from /usr/local/bin/fastlane:5:in `<main>'
@lkraider lkraider changed the title Cannot run installed "fat" gems (ie: fastlane) Cannot run installed "mono" gems (ie: fastlane) Jan 17, 2017
@anfleene
Copy link

seems like a bug in how fastlane's require works.

@anfleene
Copy link

This is a non-standard way to load gems for a binary in ruby:
https://github.com/fastlane/fastlane/blob/master/bin/fastlane#L2

The standard way is to require the gem itself.

@lkraider
Copy link
Author

I am not familiar with the gem require machinery. Created an issue over there to maybe get some helpful input.

@lkraider
Copy link
Author

@KrauseFx responded:

We don't use any non-standard things as far as I know.

Anyway, if it works with regular gem install shouldn't brew gem support it too?

@anfleene
Copy link

No it wont. On a normal gem install the binary location doesn't change. With brew-gem we symlink it and it's used for /usr/local/bin ruby automatically loads the lib directory when you require a gem so there's no need to use $LOAD_PATH. I was suggesting requiring the gem in the binary like this
https://github.com/sportngin/opsicle/blob/master/bin/opsicle#L1-L6

specifically for fastlane something like:

#!/usr/bin/env ruby
require 'rubygems'
require 'fastlane'
....

@lkraider
Copy link
Author

lkraider commented Jan 19, 2017

Well, fastlane is not changing their code (they closed the issue), so I guess brew gem will not be compatible then.

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

2 participants