Localhost apache服务器使用不同的ruby安装 . 我该怎么改变它?

我的~Library文件夹中有一个ruby安装,在我的本地用户目录中安装了ruby .

当我运行ruby命令并安装gem时,它就是本地目录中使用的那个 . 但是我想为位于Library文件夹中的ruby安装gem,或者让WAMP和localhost开始在我的本地目录中使用ruby版本 .

我已经尝试导航到~Library文件夹中的gem脚本并使用该显式路径安装gem,但它只将它们安装到本地用户版本 . 为什么localhost使用坐在库文件中的ruby?如何更改它以使用本地用户的ruby,或者如果失败,我如何为坐在库文件夹中的ruby安装gem?

谢谢

On the localhost: gem environment

'RubyGems环境:

  • RUBYGEMS版本:2.4.6

  • RUBY VERSION:2.0.0(2014-05-08 patchlevel 481)[universal.x86_64-darwin14]

  • 安装目录:/Library/Ruby/Gems/2.0.0

  • RUBY EXECUTABLE:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

  • EXECUTABLE DIRECTORY:/ usr / bin

  • SPEC CACHE目录:/Users/dzoo/.gem/specs

  • SYSTEM CONFIGURATION DIRECTORY:/ Library / Ruby / Site

  • RUBYGEMS PLATFORMS:

  • 红宝石

  • universal-darwin-14

  • GEM路径:

  • / Library / Ruby / Gems'......

In terminal: gem environment

RubyGems环境:

  • RUBYGEMS版本:2.6.4

  • RUBY VERSION:2.1.1(2014-02-24 patchlevel 76)[x86_64-darwin12.0]

  • 安装目录:/Users/dzoo/.rvm/gems/ruby-2.1.1

  • 用户安装目录:/Users/dzoo/.gem/ruby/2.1.0

  • RUBY EXECUTABLE:/Users/dzoo/.rvm/rubies/ruby-2.1.1/bin/ruby

  • 可执行目录:/Users/dzoo/.rvm/gems/ruby-2.1.1/bin

  • SPEC CACHE目录:/Users/dzoo/.gem/specs

  • SYSTEM CONFIGURATION目录:/ etc

  • RUBYGEMS PLATFORMS:

  • 红宝石

  • x86_64-darwin-12

  • GEM路径:

  • /Users/dzoo/.rvm/gems/ruby-2.1.1

  • /Users/dzoo/.rvm/gems/ruby-2.1.1@global

  • 创业板配置:

  • :update_sources => true

  • :verbose => true

  • :backtrace => false

  • :bulk_threshold => 1000

  • 远程来源:

  • https://rubygems.org/

  • SHELL PATH:

  • /Users/dzoo/bin/Sencha/Cmd/5.1.2.52

  • / Applications / PlasticSCM / server

  • / Applications / PlasticSCM / client

  • /Users/dzoo/bin/Sencha/Cmd/5.1.2.52

  • / Applications / PlasticSCM / server

  • / Applications / PlasticSCM / client

  • /Users/dzoo/.rvm/gems/ruby-2.1.1/bin

  • /Users/dzoo/.rvm/gems/ruby-2.1.1@global/bin

  • /Users/dzoo/.rvm/rubies/ruby-2.1.1/bin

  • /Users/dzoo/bin/Sencha/Cmd/5.1.2.52

  • / Applications / PlasticSCM / server

  • / Applications / PlasticSCM / client

  • / usr / bin

  • / bin

  • / usr / sbin

  • / sbin

  • / usr / local / bin

  • /usr/local/db/mongodb-osx-x86_64-2.6.1/bin

  • /Users/dzoo/bin/Sencha/Cmd/5.1.2.52

  • / opt / X11 / bin

  • /Users/dzoo/.rvm/bin

  • / usr / local / sbin

回答(0)