I complete a simple Ror hello world application. The problem for me now is how i can deploy it another Window machine which is physically off to the Internet. I can copy files and application by USB. But how can i install gem to that machine? Does anyone have similar experience?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can do bundle package
to package the gems (in a machine with internet) and copy over.
You can then install local gems using bundler:
bundle install --local
Not that you could get bundle gem itself by doing:
gem install --local bundle.gem
where bundle.gem
is obtained using gem fetch bundler
.
回答2:
If you're talking about your application's dependencies, take a look at the bundle package command, which will download all of the dependencies to ./vendor/cache
. You can then copy the vendor
along with your application and Bundler will it instead of fetching the gems off the internet.