如何解决与nokogiri有关的安装包错误?

时间:2019-08-23 05:37:33

标签: ruby-on-rails ruby-on-rails-5 bundler nokogiri

尝试捆绑安装较旧的项目时出现此错误。我被卡住了,不确定如何解决。我在多个项目中出错。有维护的方法吗?我试过捆绑更新。有人有什么想法吗?我已升级到macOS Mojave 10.14.6。谢谢

public class UnoCard {
    enum Color {
        RED, BLUE, GREEN, YELLOW, WILD;

        private static final Color[] colors = Color.values();
        public static Color getColor(int i){
            return Color.colors[i];
        }

        enum Value {
            ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, SKIP, DRAW_TWO, REVERSE, WILD, WILD_FOUR;
            private static final Value[] values = Value.values();
            public static Value getValue(int i){
                return Value.values[i];
            }
    }

    private final Color color;
    private final Value value;

    public UnoCard(final Color color, final Value value){
        this.color = color;
        this.value = value;
    }

    public Color getColor(){
        return this.color;
    }

    public Value getValue(){
        return this.value;
    }

    @Override
    public String toString() {
        return color + "_" + value;
    }
}

1 个答案:

答案 0 :(得分:2)

运行以下命令:

gem uninstall nokogiri
xcode-select --install
gem install nokogiri

来源:http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x

有时Mac更新可能会破坏xcode CLI,因此重新安装可以解决以下问题:https://github.com/sparklemotion/nokogiri/issues/1445

*

  

https://stackoverflow.com/a/37757604/11544569

*