我需要在脱机服务器上安装"全局"npm应用程序.
安装普通应用程序很容易:
npm install
Run Code Online (Sandbox Code Playgroud)
然后打包生成的文件.手动或使用npm包.
但是,如何安装全局应用程序(具有某种安装脚本),例如永远没有Internet?
npm install -g forever
Run Code Online (Sandbox Code Playgroud) 我有一个完全与Internet断开连接的服务器(出于一些奇怪的安全原因).
如何使Ruby依赖于各种gems在该环境中工作?它可能适用于Bundler,但如何在没有Internet连接的情况下使用gem安装Bundler ?
我已经安装了我的依赖项
bundle package
Run Code Online (Sandbox Code Playgroud)
然后将它们转移到离线服务器并运行:
> bundle install --local
Using mime-types (1.19)
Using rest-client (1.6.7)
Using trollop (1.16.2)
Using bundler (1.1.4)
Your bundle is complete! It was installed into ./vendor/bundle
Run Code Online (Sandbox Code Playgroud)
但是,无法运行该应用程序:
ruby someprogram.rb
/usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- trollop (LoadError)
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from someprogram.rb:2:in `<main>'
Run Code Online (Sandbox Code Playgroud)
我需要为Ruby指定什么才能运行本地安装的gem?