【问题标题】:Ruby dependency issue on MacOSXMacOS 上的 Ruby 依赖问题
【发布时间】:2014-11-27 17:39:00
【问题描述】:

我正在尝试使用出色的交付工具 (https://github.com/KrauseFx/deliver),但我对 ruby​​ 一无所知。因此,当我尝试运行 Deliver init 并收到此消息时,我不知道该怎么办:

/Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2052:in `raise_if_conflicts': can't activate json-1.6.8, already activated json-1.8.1 (Gem::LoadError)
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1262:in `activate'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:96:in `block in require'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:95:in `each'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:95:in `require'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0@global/gems/deliver-0.3.6/lib/deliver.rb:1:in `<top (required)>'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0@global/gems/deliver-0.3.6/bin/deliver:5:in `<top (required)>'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/bin/deliver:23:in `load'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/bin/deliver:23:in `<main>'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'

我该怎么办?顺便说一句,我在 MacOSX Yosemite 上。

【问题讨论】:

    标签: ruby macos rvm


    【解决方案1】:

    如果你正在使用 bundler 并且你有一个 Gemfile,你可以尝试使用 bundle 运行它:

    bundle exec deliver init
    

    这样,Gemfile 将为您选择正确版本的 json gem。

    如果你没有使用 bundler,你应该卸载更新版本的 json 使用:

    gem uninstall json
    

    并选择要卸载的 1.8.1。然后你可以尝试再次运行deliver init

    【讨论】:

      【解决方案2】:

      事实上,我所要做的就是使用“sudo gem install json”安装 json,它解决了我的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-04-12
        • 1970-01-01
        • 2012-05-23
        • 1970-01-01
        相关资源
        最近更新 更多