Cocoapods的新功能,安装后不断出错

时间:2016-07-12 02:39:49

标签: cocoapods

这是我第一次这样做,但在按照网上关于可可豆荚的说明后,似乎我在安装后无法使用它。有人可以帮忙吗?

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    Spinner state  = (Spinner) findViewById(R.id.spinnerState);
    ArrayAdapter<CharSequence> stateadapter = ArrayAdapter.createFromResource(
            this, R.array.item_state, android.R.layout.simple_spinner_item);
    stateadapter.setDropDownViewResource(R.layout.spinner_layout);
    state.setAdapter(stateadapter);




    Spinner city  = (Spinner) findViewById(R.id.spinnerCity);
    ArrayAdapter<CharSequence> cityadapter = ArrayAdapter.createFromResource(
            this, R.array.item_city, android.R.layout.simple_spinner_item);
    cityadapter.setDropDownViewResource(R.layout.spinner_layout);
    city.setAdapter(cityadapter);


 }}

然后我尝试了这种方式

Ronalds-Air:~ ronaldm$ gem install cocoapods --user-install
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb:213: warning: Insecure world writable dir /Users/ronaldm in PATH, mode 040707
Fetching: cocoapods-1.0.1.gem (100%)
WARNING:  You don't have /Users/ronaldm/.gem/ruby/2.0.0/bin in your PATH,
  gem executables will not run.
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
1 gem installed

我试过sudo但是没有帮助,任何帮助都会非常感激

1 个答案:

答案 0 :(得分:1)

该错误不会阻止您向iOS添加依赖项,但它将阻止您运行任何gem可执行文件。

在〜/ .bash_profile的底部添加以下行(如果它不存在,则创建它)

export PATH="~/.gem/ruby/2.0.0/bin:$PATH"