Giter Club home page Giter Club logo

Comments (8)

mpapis avatar mpapis commented on June 30, 2024

please test with:

gem install rubygems-bundler --pre
NOEXEC=0 rails new app

It will basically not load Gemfile from current directory to use rails, and everything will work correctly, I have added a test case for it: https://github.com/mpapis/rubygems-bundler/blob/1.0.0/test/dtf/rails_and_gemfile_comment_test.sh

from rubygems-bundler.

TMorgan99 avatar TMorgan99 commented on June 30, 2024

Good thanks!
I installed

$ gem install rubygems-bundler --pre  ( 1.0.0 beta5 )

which prompted me to

$ gem uninstall -ax rubygems-bundler -v 0.9.2

next, I reset my .gemrc to include

custom_shebang: $env ruby_noexec_wrapper

and then I reset my wrappers with

$ gem regenerate_binstubs                                   

Now, the result:

$ rails new app                      # => no Gemfile.lock
$ NOEXEC=0 rails new app  # => Gemfile.lock created

from rubygems-bundler.

mpapis avatar mpapis commented on June 30, 2024

you do not need the .gemrc part anymore:

custom_shebang: $env ruby_noexec_wrapper

this is now automated.

from rubygems-bundler.

TMorgan99 avatar TMorgan99 commented on June 30, 2024

Wow! --- better and better!

from rubygems-bundler.

TMorgan99 avatar TMorgan99 commented on June 30, 2024

How I discovered it:
I am running with .railsrc set to --skip-bundle and -m pointing to my template generator.
My template generator builds the Gemfile, then runs bundle, and finally runs further generators in the app.
Now, with a global NOEXEC=0, won't these generators need a bundle exec prefix in my template?

from rubygems-bundler.

mpapis avatar mpapis commented on June 30, 2024

I'm not sure at all, basically after the directory is changed to the new project dir you could do one of this two things:

unset NOEXEC
NOEXEC=1

from rubygems-bundler.

TMorgan99 avatar TMorgan99 commented on June 30, 2024

my script starts off like this...

  ## check env for NOEXEC=0 
  unless  ENV[ 'NOEXEC' ] == '0'
    say '==> please set NOEXEC=0 to run this script'
    exit
  end
  # great, now unset it.
  ENV[ 'NOEXEC' ] = nil

looks clumsy, but it works

from rubygems-bundler.

mpapis avatar mpapis commented on June 30, 2024

this made me laugh, maybe better add a comment explaining it is needed because of calling rails in context of wrong Gemfile, I would drop the code first time I would see it in my project

from rubygems-bundler.

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.