2012-11-22 41 views
0

無效字節序列如下所示這樣一步一步:的CocoaPods:在US-ASCII

### Stack 

``` 
    CocoaPods : 0.15.2 
     Ruby : ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0] 
    RubyGems : 1.8.24 
     Host : Mac OS X 10.8.2 (12C60) 
     Xcode : 4.5.2 (4G2008a) 
Ruby lib dir : /usr/local/rvm/rubies/ruby-1.9.3-p194/lib 
Repositories : master - https://github.com/CocoaPods/Specs.git @ 60b51e341f727b7d715ed541ea9cb52f6e0cc819 
``` 

### Podfile 

```ruby 
      platform :ios, '6.0' 
pod 'AFNetworking', '1.0' 
``` 

### Error 

``` 
invalid byte sequence in US-ASCII 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/local_pod.rb:540:in `glob' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/local_pod.rb:540:in `glob' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/local_pod.rb:540:in `block in expanded_paths' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/local_pod.rb:534:in `map' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/local_pod.rb:534:in `expanded_paths' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/local_pod.rb:327:in `readme_file' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/generator/documentation.rb:50:in `index_file' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/generator/documentation.rb:70:in `appledoc_options' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/generator/documentation.rb:81:in `generate' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/installer.rb:91:in `generate_docs' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/installer.rb:60:in `block (2 levels) in install_dependencies!' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/user_interface.rb:37:in `section' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/installer.rb:53:in `block in install_dependencies!' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/installer.rb:50:in `each' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/installer.rb:50:in `install_dependencies!' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/installer.rb:119:in `block in install!' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/user_interface.rb:37:in `section' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/installer.rb:118:in `install!' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/command/install.rb:46:in `run_install_with_update' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/command/install.rb:51:in `run' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/lib/cocoapods/command.rb:75:in `run' 
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/cocoapods-0.15.2/bin/pod:16:in `<top (required)>' 
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/pod:19:in `load' 
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/pod:19:in `<main>' 
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval' 
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>' 
``` 

UPD: http://www.raywenderlich.com/12139/introduction-to-cocoapods

在不同的項目中運行的pod install,當我得到一個錯誤。

➜ ~ gem install cocoapods 
zsh: correct 'cocoapods' to '.cocoapods' [nyae]? n 
Fetching: xcodeproj-0.4.0.gem (100%) 
Building native extensions. This could take a while... 
ERROR: Error installing cocoapods: 
    ERROR: Failed to build gem native extension. 

     /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for -std=c99 option to compiler... *** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby 
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile' 
    from extconf.rb:24:in `block in <main>' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' 
    from extconf.rb:23:in `<main>' 


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/xcodeproj-0.4.0 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/xcodeproj-0.4.0/ext/xcodeproj/gem_make.out 
+0

我無法重現此。你能否檢查這個問題是否也出現在最新的CP版本0.16中? – alloy

+0

@alloy我不知道如何更新可可豆莢,所以我運行安裝,並得到一些問題...你可以請看看* Upd:*? 謝謝你的建議。 – Shmidt

回答

0

問題出在Ruby編譯器,它被其他一些應用程序破壞了。 重新安裝後,一切工作正常。