ruby - how to avoid installing rails as a system gem by using bundler and expect -


i'm trying make new rails application intent not install gems system gem possible. @ first installed bundler system gem, made gemfile specified rails , executed 'bundle install'. (in opinion, bundler ok system gem...)

mkdir -p /opt/rails/rails_app cd /opt/rails/rails_app gem install bundler bundle init cp gemfile /tmp sed 's/#gem rails/gem rails/' /tmp/gemfile > gemfile bundle config build.nokogiri --use-system-libraries bundle install --path vendor/bundle 

rails installed 'local gem' limitted within /opt/rails/rails_app.

then tried make rails application 'rails new'.

bundle exec rails new . --skip-bundle 

this caused replacing gemfile, message shown this.

overwrite /opt/rails/rails_app/gemfile? (enter "h" help) [ynaqdh] 

usually should done type 'y'. however, time, want automatically making vagrant's provision script.

so tried expect never worked. results either timeout or syntax error:

expect -c " spawn bundle exec rails new . --skip-bundle --quiet expect \"overwrite /opt/rails/rails_app/gemfile? (enter \"h\" help) \[ynaqdh\] \" send \"y\r\" " 

i couldn't find wrong in code , other solutions using expect.

it looks there skip_gemfile option in rails generator


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -