I'm a little confused. Running bundle package of course grabs gems and sticks them in vendor/cache. However, I've always seen them come from rubygems.org.
Today I ran that command and it started getting those gems from rubygems.global.ssl.fastly.net. Has my bundler installation been compromised, or did a legitimate change happen that's now causing bundler to get gems from that new source?
Yes, rubygems is trying out fastly as their CDN.
Related
I've been using Middleman since a while, but very recently it is getting some issues in loading.
This is likely due to the coexistence of very old gems of the same type.
Have to say that I did follow some online suggestions, but haven't really got the full understanding. So ended up using rbenv for managing ruby then bundle to install the gems.
Now, have two project that for which I need to "reset" and install only the referenced gems into the local folder or somehow they don't conflict.
I can't figure out how to do it.
Using the rbenv -local I can change the local ruby version, but not sure how to move next.
Any help?
Thanks
I don't think you need rbenv or rvm for this, although their are good tools. To run a piece of code with just the gems you need, and the versions you specified in your Gemfile, run any command prefixed with bundle exec.
For example bundle exec middleman server.
I had some problems with Bundler and stopped using it for a while. Now, I'm getting back to using it, and read up on it more this time and decided these are the first commands I should run:
bundle install --binstubs --path vendor
bundle package
I know that future calls to bundle will remember the path, but now I've updated my Gemfile with a new gem, should I run...?
bundle install - Bundler will work out that I already have the other gems cached, and I want executables to bin/.
bundle install --local - Bundler needs to know I want to use the cached gems but remembers the other stuff. This doesn't work (or, more precisely, isn't for this situation), just use bundle install and it won't reinstall current gems (although I've seen it do that which is why I asked)
bundle install --local --binstubs - Bundler isn't going to remember anything and I need to provide it.
Any other combination/commands I'm not aware of.
And then, do I need to re-run bundle package again after this? My experiments show me that re-running bundle package is not required, the cache is updated with new gems.
I did read the docs, (and a couple of blogs, though finding up-to-date ones is quite difficult) but this isn't clear to me.
Any help is much appreciated.
Certain options are what bundler calls remembered options and are stored in .bundle/config. These remembered options don't need to be typed again and again.
According to the http://gembundler.com/man/bundle-install.1.html#REMEMBERED-OPTIONS, the remembered options are --deployment, --path, --binstubs, --without
I tried searching for this several times, but if this question has been answered already I didn't find it.
So, let's say I've developed a plain old gem (not a Rails app). I already know how to use Bundler for development, so I have a Gemfile and everything in my repository. However, I want this gem to use Bundler for dependency resolution when I install it, not just when I work on it.
Is there a way to do so, or would I have to resort to running its commands from a git checkout with bundle exec?
Bundler resolves dependencies not only for development. Just run bundle install on production server after deployment and it will install all needed gems there too.
If you need to install gems from several repositories, add row in you Gemfile:
source 'http://you_repository.com
My connection to default gem source server http://rubygems.org/ is slow. So I am looking for a method to build a private gem server on a machine which I have fast connection to. I have some questions after reading gems doc:
If I have multiple gem sources , what is the order which source is used when running gem install xxx?
Will any method documented in http://docs.rubygems.org/read/chapter/18 help build a transparent gem server? "Transparent" means I need this only one gem server in my gem sources, and when I request a gem from this server, it will first serve the gem from cache. If the gem is not in cache yet, the server will try to download it from http://rubygems.org/, serve and cache it.
If the answer for question 2 is "No", how can I build a transparent gem source server?
I'd suggest just installing the pre-release bundler, which is several orders of magnitude faster due to major architectural changes. It's not just your connection to rubygems that is slow; it's that painful for all of us ;) gem install bundler --pre will give you a much faster bundler.
That said, if you really want a loca gem server, try Gem in a box:
https://github.com/cwninja/geminabox
Here are a few projects that are specifically made to run a RubyGems.org mirror:
https://github.com/YorickPeterse/gem-mirror
https://github.com/rubygems/rubygems-mirror
I'd like to get the fastri engine working with bundler driven projects. Anybody know how to do this.
First, you would need to get bundler to stop using --no-ri --no-rdoc:
https://github.com/carlhuda/bundler/issues/383
Assuming you could get bundler to install the docs, your next problem is to point fastri to the GEM_PATH that bundler installed to. But you're a long way from that concern. :-(