-
Notifications
You must be signed in to change notification settings - Fork 283
Use bundled Gems defined within a Gemfile #157
base: master
Are you sure you want to change the base?
Conversation
Currently stuck figuring out how to deal with the circular references for CP and plugins depending on it.
|
5839345
to
a24e1dd
Compare
Issue may just be rubygems not being smart about installing them all at once :( May need to install them in topological order? |
install_gem 'cocoapods', install_cocoapods_version | ||
execute "bundling", ["rm", "-rf", WORKBENCH_DIR + "/ruby"] | ||
# Can figure this one out later | ||
bundler = "/Users/orta/.rvm/gems/ruby-2.1.3/wrappers/bundle" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really couldn't figure out how to use the user's install of bundler, tried a bunch of things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps via $GEM_HOME?
$ echo $GEM_HOME
/Users/kyle/gems
$ ls $GEM_HOME
bin bundler doc specifications
build_info cache gems
Remember to fall back to correct path when GEM_HOME isn't set. There is probably some RubyGems/Bundler code to look up this place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand the goal of this PR correctly, then you might want to do something like the following to get the path:
$ bundle show gem
@segiddins - is there an easy way to get the topological order of the gems? ( e.g. could I ask bundler "make the "cocoapods" gem dep tree" then go from the leafs of the dep tree and do a depth first approach? ) |
@orta yes. |
Interesting, I think I have a newer version of bundler, and now I don't have the issues around topological installs |
@segiddins - I'm a tough point, where I'm not 100% sure if I've hit a bundler bug $ rake app:prerequisites
[09:01:48] [Submodules] /usr/bin/git submodule update --init --recursive
[09:01:49] [ruby-2.2.3] cd workbench/ruby-2.2.3 && /usr/bin/make install
[... a totally blank ruby is installed]
# installed bundler inside the new hosted ruby env
[09:01:59] [bundling] destroot/bundle/bin/bundle-env gem install bundler --verbose
# Use the new bundler to install our gems
[09:02:03] [bundling] destroot/bundle/bin/bundle install --gemfile bundled-Gemfile
# I get a bunch of these errors:
Ignoring json-1.8.3 because its extensions are not built. Try: gem pristine json --version 1.8.3
Ignoring json-1.8.2 because its extensions are not built. Try: gem pristine json --version 1.8.2
Ignoring json-1.7.7 because its extensions are not built. Try: gem pristine json --version 1.7.7
Ignoring kgio-2.9.2 because its extensions are not built. Try: gem pristine kgio --version 2.9.2
# Then is starts downloading
Fetching https://github.com/CocoaPods/CocoaPods.git
Fetching https://github.com/CocoaPods/Core.git
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Installing i18n 0.7.0
Installing json 1.8.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
# Showing this error:
current directory: /Users/orta/dev/mac/apps/CocoaPods-app/path/ruby/2.2.0/gems/json-1.8.3/ext/json/ext/generator
/Users/orta/dev/mac/apps/CocoaPods-app/destroot/bundle/bin/ruby -r ./siteconf20160410-46161-ao5uqb.rb extconf.rb
/Users/orta/.rvm/gems/ruby-2.1.3/gems/bundler-1.11.2/lib/bundler/source/git/git_proxy.rb:183:in `allowed_in_path': The git source https://github.com/CocoaPods/CocoaPods.git is not yet checked out. Please run `bundle install` before trying to start your application (Bundler::GitError)
from /Users/orta/.rvm/gems/ruby-2.1.3/gems/bundler-1.11.2/lib/bundler/source/git/git_proxy.rb:47:in `revision'
from /Users/orta/.rvm/gems/ruby-2.1.3/gems/bundler-1.11.2/lib/bundler/source/git.rb:215:in `revision'
from /Users/orta/.rvm/gems/ruby-2.1.3/gems/bundler-1.11.2/lib/bundler/source/git.rb:87:in `install_path'
from /Users/orta/.rvm/gems/ruby-2.1.3/gems/bundler-1.11.2/lib/bundler/source/path.rb:110:in `expanded_path' The error message is weird though, it's the JSON gem failing, but then the message talks about how CocoaPods cannot be checked out, even though it was a few lines above, can you think if I'm doing anything odd? |
( sorry sent the message early, wrapped it up in an edit ) I wonder if it's using one bundler environment, then jumping to another, might try a different idea |
@orta that won't really happen, bundler basically just uses a single definition. If it's telling you something isn't checked out, you might need to add a |
I've got most of the way.