Git Product home page Git Product logo

Comments (11)

glensc avatar glensc commented on June 23, 2024

each bin wrappers have this code:

ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil unless ENV["APPBUNDLER_ALLOW_RVM"] == "true"

so it may help to set APPBUNDLER_ALLOW_RVM=true and then override $GEM_HOME

from chef-dk.

glensc avatar glensc commented on June 23, 2024

and the above seems to be related to appbundler: https://github.com/opscode/appbundler#rvm

from chef-dk.

danielsdeleo avatar danielsdeleo commented on June 23, 2024

Yeah, the binaries need to be rvm resistant, and APPBUNDLER_ALLOW_RVM=true is just a hack we use for travis (which uses rvm). But this should be pretty easy to do. Probably best to put user-installed gems in your home directory somewhere.

from chef-dk.

schisamo avatar schisamo commented on June 23, 2024

We should consider writing gems to something like ~/.chefdk.d/gems. This is similar to how Vagrant works:

➜  ls -la ~/.vagrant.d/gems/
total 0
drwxr-xr-x   8 schisamo  staff  272 Mar 11 13:55 .
drwxr-xr-x  12 schisamo  staff  408 Apr 22 14:06 ..
drwxr-xr-x   7 schisamo  staff  238 Mar 17 06:39 build_info
drwxr-xr-x   7 schisamo  staff  238 Mar 17 06:39 cache
drwxr-xr-x   2 schisamo  staff   68 Mar 11 13:55 doc
drwxr-xr-x   7 schisamo  staff  238 Mar 17 06:39 gems
drwxr-xr-x   3 schisamo  staff  102 Mar 11 13:53 ruby
drwxr-xr-x   7 schisamo  staff  238 Mar 17 06:39 specifications

A ~/.chefdk.d directory would also give us a staging area for other required directories/assets.

from chef-dk.

danielsdeleo avatar danielsdeleo commented on June 23, 2024

@schisamo working on that right now

from chef-dk.

schisamo avatar schisamo commented on June 23, 2024

@danielsdeleo

from chef-dk.

smith avatar smith commented on June 23, 2024

Would it make sense to just use ~/.chef/gems?

from chef-dk.

danielsdeleo avatar danielsdeleo commented on June 23, 2024

Merged a fix to omnibus-chef: chef-boneyard/omnibus-chef@af1f058 This will be fixed in the next chefdk release.

from chef-dk.

jtimberman avatar jtimberman commented on June 23, 2024

@danielsdeleo - ❤️

from chef-dk.

aalmenar avatar aalmenar commented on June 23, 2024

This exactly happens again in version 0.8.0 on OSX El Capitan

from chef-dk.

tonytonyjan avatar tonytonyjan commented on June 23, 2024

I occurred the same problem when use kitchen, it tries to write /opt/chefdk/embedded/lib/ruby/gems/2.1.0 instead of .chefdk/gem/ruby/2.1.0.

$ kitchen init
   identical  .kitchen.yml
   identical  chefignore
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /opt/chefdk/embedded/lib/ruby/gems/2.1.0 directory.

My environment:

$ sw_vers -productVersion
10.11.2
$ chef gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.8
  - RUBY VERSION: 2.1.6 (2015-04-13 patchlevel 336) [x86_64-darwin12.0]
  - INSTALLATION DIRECTORY: /opt/chefdk/embedded/lib/ruby/gems/2.1.0
  - RUBY EXECUTABLE: /opt/chefdk/embedded/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/chefdk/embedded/bin
  - SPEC CACHE DIRECTORY: /Users/tonytonyjan/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /opt/chefdk/embedded/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-12
  - GEM PATHS:
     - /opt/chefdk/embedded/lib/ruby/gems/2.1.0
     - /Users/tonytonyjan/.chefdk/gem/ruby/2.1.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "-N"
     - "update" => "-N"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/tonytonyjan/.pyenv/shims
     - /Users/tonytonyjan/.rbenv/shims
     - /Users/tonytonyjan/.pyenv/shims
     - /Users/tonytonyjan/.rbenv/shims
     - /Users/tonytonyjan/bin
     - /Users/tonytonyjan/.pyenv/shims
     - /Users/tonytonyjan/.rbenv/shims
     - /usr/local/sbin
     - ./node_modules/.bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /opt/X11/bin
     - /usr/texbin

from chef-dk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.