iOSアプリ開発の処方箋 : RubyMotionでrakeするとNo headers to parseとなりiOSシミュレータが起動しない

More than 1 year has passed since last update.

RubyMotion 製の GitHub news feed リーダーアプリ「motion-octofeed」を利用して手を入れつつ勉強しています。
rakeコマンドでiOSシミュレータを起ち上げようとしたら、No headers to parseというエラーが発生して動きません。

本記事は、次の記事の続編です。

RubyMotion - iOSアプリ開発の処方箋 : Unable to find a specification for AFNetworking (~> 2.0). - Qiita
http://qiita.com/y-ken/items/2e4c3fed1d29e8f5d6ba

エラー事象

Buildの後にCompileという文字が出力されてビルドが進むのが通常です。
しかし、No headers to parseとなり途中で落ちるのです。

エラー内容

$ cd motion-octofeed/
$ rake
  WARNING! BubbleWrap::HTTP is deprecated and will be removed, see https://github.com/rubymotion/BubbleWrap/issues/308
  WARNING! Switch to a different networking library soon - consider AFNetworking: http://afnetworking.com/
  WARNING! You can use the 'bubble-wrap-http' gem if you need compatibility: https://github.com/rubymotion/BubbleWrap-HTTP
     Build ./build/iPhoneSimulator-7.0-Development
Received exception: No headers to parse:
/usr/bin/gen_bridge_metadata:979:in `prepare'
/usr/bin/gen_bridge_metadata:775:in `parse'
/Library/RubyMotion/bin/gen_bridge_metadata:118:in `block in <main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/optparse.rb:885:in `initialize'
/Library/RubyMotion/bin/gen_bridge_metadata:38:in `new'
/Library/RubyMotion/bin/gen_bridge_metadata:38:in `<main>'
No headers to parse
Usage: gen_bridge_metadata [options] <headers...>
Use the `-h' flag or consult gen_bridge_metadata(1) for help.
rake aborted!
Command failed with status (1): [RUBYOPT='' '/Library/RubyMotion/bin/gen_br...]
/Library/RubyMotion/lib/motion/project/xcode_config.rb:402:in `gen_bridge_metadata'
/Library/RubyMotion/lib/motion/project/vendor.rb:228:in `block in build_xcode'
/Library/RubyMotion/lib/motion/project/vendor.rb:152:in `chdir'
/Library/RubyMotion/lib/motion/project/vendor.rb:152:in `build_xcode'
/Library/RubyMotion/lib/motion/project/vendor.rb:44:in `build'
/Library/RubyMotion/lib/motion/project/builder.rb:69:in `block in build'
/Library/RubyMotion/lib/motion/project/builder.rb:68:in `each'
/Library/RubyMotion/lib/motion/project/builder.rb:68:in `build'
/Library/RubyMotion/lib/motion/project/app.rb:78:in `build'
/Users/ken/Documents/htdocs/motion-octofeed/vendor/bundle/ruby/2.1.0/gems/motion-cocoapods-1.5.0/lib/motion/project/cocoapods.rb:53:in `build_with_cocoapods'
/Library/RubyMotion/lib/motion/project/template/ios.rb:68:in `block (2 levels) in <top (required)>'
/Library/RubyMotion/lib/motion/project/template/ios.rb:138:in `block in <top (required)>'
Tasks: TOP => build:simulator

...以下略...

対処法

次の記事によると、CocoaPodsを使う準備が足りていないようです。
pod setupしたらrake pod:installしましょう。と記載されているので、その通りに実行してみます。

Firebase CocoaPod does not install (“no headers to parse”) · Issue #53 · HipByte/motion-cocoapods
https://github.com/HipByte/motion-cocoapods/issues/53#issuecomment-54151578

$ rake pod:install
  WARNING! BubbleWrap::HTTP is deprecated and will be removed, see https://github.com/rubymotion/BubbleWrap/issues/308
  WARNING! Switch to a different networking library soon - consider AFNetworking: http://afnetworking.com/
  WARNING! You can use the 'bubble-wrap-http' gem if you need compatibility: https://github.com/rubymotion/BubbleWrap-HTTP
Updating spec repo `master`
Updating f679174..c4affe1

Fast-forward

 CocoaPods-version.yml                              |   2 +-

 Specs/ADALiOS/1.1.1/ADALiOS.podspec.json           |  32 ++

...中略...

CocoaPods 0.34.0.rc2 is available.
To update use: sudo gem install cocoapods\n
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (1.3.4)
Generating Pods project

5分〜10分程度掛かりますが、何とか終了したようです。

結果

rakeコマンドを実行すると、期待通りコンパイルが進み、iOSシミュレータが起動しました。

octofeed_ios7_simulator.png

rakeコマンドの出力は次の通りです。

$ rake
  WARNING! BubbleWrap::HTTP is deprecated and will be removed, see https://github.com/rubymotion/BubbleWrap/issues/308
  WARNING! Switch to a different networking library soon - consider AFNetworking: http://afnetworking.com/
  WARNING! You can use the 'bubble-wrap-http' gem if you need compatibility: https://github.com/rubymotion/BubbleWrap-HTTP
     Build ./build/iPhoneSimulator-7.0-Development
     Build ./vendor/Pods/Pods.xcodeproj [AFNetworking - Release]
   Compile ./vendor/Pods/Pods-AFNetworking-prefix.pch
   Compile ./vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m
   Compile ./vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m
   Compile ./vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m
   Compile ./vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m
   Compile ./vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m
   Compile ./vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m
   Compile ./vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m
   Compile ./vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m
   Compile ./vendor/Pods/Pods-AFNetworking-dummy.m
   Compile ./vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m
      Link ./vendor/Pods/.build/libPods-AFNetworking.a
     Build ./vendor/Pods/Pods.xcodeproj [Pods - Release]
   Compile ./vendor/Pods/Pods-dummy.m
      Link ./vendor/Pods/.build/libPods.a
   Compile /Users/y-ken/Documents/htdocs/motion-octofeed/vendor/bundle/ruby/2.1.0/gems/bubble-wrap-1.7.1/motion/shortcut.rb
   Compile /Users/y-ken/Documents/htdocs/motion-octofeed/vendor/bundle/ruby/2.1.0/gems/bubble-wrap-http-1.7.1/motion/http/response.rb

...中略...

   Compile ./app/setting_list_view_controller.rb
   Compile ./app/github_manager.rb
   Compile ./app/notification_table_view_cell.rb
   Compile ./app/bw_rss_parser_for_github.rb
   Compile ./app/main_table_view_cell.rb
   Compile ./app/feature_profile_view_controller.rb
   Compile ./app/feature_template_webview_controller.rb
   Compile ./app/issue_table_view_cell.rb
   Compile ./app/issue_detail_table_view_controller.rb
   Compile ./app/issue_detail_table_view_cell.rb
   Compile ./app/issue_detail_comment_table_view_cell.rb
   Compile ./app/feature_readme_view_controller.rb
   Compile ./app/issue_table_view_controller.rb
   Compile ./app/webview_controller.rb
   Compile ./app/detail_view_controller.rb
   Compile ./app/issue_tabbar_controller.rb
   Compile ./app/app_delegate.rb
   Compile ./app/github.rb
   Compile ./app/notification_table_view_controller.rb
   Compile ./app/main_table_view_controller.rb
   Compile ./app/setting_github_account_view_controller.rb
    Create ./build/iPhoneSimulator-7.0-Development/Octofeed.app
      Link ./build/iPhoneSimulator-7.0-Development/Octofeed.app/Octofeed
    Create ./build/iPhoneSimulator-7.0-Development/Octofeed.app/PkgInfo
    Create ./build/iPhoneSimulator-7.0-Development/Octofeed.app/Info.plist
      Copy ./resources/am_github_api_follow.png
      Copy ./resources/am_github_api_star.png
      Copy ./resources/am_github_api_watch.png
      Copy ./resources/am_hatenabookmark_activity.png
      Copy ./resources/am_open_in_hatenabookmark_activity.png
      Copy ./resources/am_open_in_safari_activity.png
      Copy ./resources/btn_cog_32.png
      Copy ./resources/Default-568h@2x.png
      Copy ./resources/Default.png
      Copy ./resources/Default@2x.png
      Copy ./resources/Icon-120.png
      Copy ./resources/Icon-72.png
      Copy ./resources/Icon-Small-50.png
      Copy ./resources/Icon-Small.png
      Copy ./resources/Icon-Small@2x.png
      Copy ./resources/Icon.png
      Copy ./resources/Icon@2x.png
      Copy ./resources/iTunesArtwork.png
      Copy ./resources/open_in_safari_activity.png
      Copy ./resources/tabbar_close.png
      Copy ./resources/tabbar_feed.png
      Copy ./resources/tabbar_notification.png
      Copy ./resources/tabbar_open.png
      Copy ./resources/toolbar_info.png
      Copy ./resources/unread.png
    Create ./build/iPhoneSimulator-7.0-Development/Octofeed.dSYM
  Simulate ./build/iPhoneSimulator-7.0-Development/Octofeed.app
(main)>
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.