ruby - Installing gems on locally to the project folder for portability reasons -
i trying containerize rails project. reason, want have rails project can copy , paste machine can run on other machine without having run "bundle install" on other machine. there way install dependencies in project folder, deploy project folder other machine , directly run there?
sure. project's top-level folder run
bundle install --path vendor/cache
this install required gems subfolder under vendor
. can copy entire project folder other machine , necessary gems come along it.
to execute commands rely on these locally-installed gems you'll need prefix each command bundle exec
, e.g.
bundle exec rails server
alternatively, use capistrano manage whole process (deploying project remote server , installing necessary gems) you.
Comments
Post a Comment