Problems with RubyMotion and CocoaPods

I have different problems getting CocoaPods dependencies to work in RubyMotion. Firstly, if I add the dependency 'JSONKit' to my Rakefile and then run rake , it will be aborted with a can't convert Pathname into String error. rake --trace then produces the following output:

 ** Invoke default (first_time) ** Invoke simulator (first_time) ** Invoke build:simulator (first_time) ** Execute build:simulator /usr/bin/gen_bridge_metadata --format complete --no-64-bit --cflags "-I. -I." JSONKit.h -o "JSONKit.bridgesupport" invalid option: --no-64-bit 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): [/usr/bin/gen_bridge_metadata --format comp...] /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/file_utils.rb:53:in `block in create_shell_runner' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/file_utils.rb:45:in `call' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/file_utils.rb:45:in `sh' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `sh' /Library/RubyMotion/lib/motion/project/vendor.rb:93:in `block in build_static' /Library/RubyMotion/lib/motion/project/vendor.rb:34:in `chdir' /Library/RubyMotion/lib/motion/project/vendor.rb:34:in `build_static' /Library/RubyMotion/lib/motion/project/vendor.rb:23:in `build' /Library/RubyMotion/lib/motion/project/builder.rb:37:in `block in build' /Library/RubyMotion/lib/motion/project/builder.rb:36:in `each' /Library/RubyMotion/lib/motion/project/builder.rb:36:in `build' /Library/RubyMotion/lib/motion/project/app.rb:50:in `build' /Library/RubyMotion/lib/motion/project.rb:33:in `block (2 levels) in <top (required)>' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:205:in `call' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:200:in `each' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:200:in `execute' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:174:in `each' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:174:in `each' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/task.rb:144:in `invoke' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:94:in `each' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:88:in `top_level' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:66:in `block in run' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling' /Users/xxxx/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:63:in `run' /Users/xxxx/.rbenv/versions/1.9.3-p194/bin/rake:32:in `<main>' Tasks: TOP => default => simulator => build:simulator 

The vendor directory in the project contains various JSONKit files.

Secondly, in another RubyMotion application, if I add the dependency 'Nimbus' to my Rakefile and then run rake , building applications, but errors with uninitialized persistent errors when I try to use anything related to Nimbus in my code, and no provider creates a directory.

What is the problem in these two cases?

+4
source share
2 answers

There are a couple of questions here.

cannot convert pathname to string

Update: as of 5/7/12 you can just sudo motion update and this will be fixed

This error is due to the fact that you are using Ruby 1.9. Although I do not see an explicit indication in the documentation in it, the fact that examples of setting this parameter relate to the use of sudo in gem install commands means that it suggested that you use the OS X built-in ruby โ€‹โ€‹(1.8. 7). If you switch the project to a system ruby โ€‹โ€‹(add the .rbenv-version file with system ). Alternatively, if you want to stick with 1.9, you can change line 22 /Library/RubyMotion/lib/motion/project/vendor.rb as follows:

 App.info 'Build', @path.to_s 

As soon as you do this, you will have the opportunity:

 ERROR! Building vendor project `./vendor/JSONKit' failed to create at least one `.a' library.` 

You will need to edit line 77 of the same file:

 objs = Dir.glob('**/*.o') # Removed the leading "*/" 

Then rake should finally work correctly.

The motion-cocoapods repository noted a problem with these problems: https://github.com/HipByte/motion-cocoapods/issues/1

In addition, I just filed an official support ticket using motion support . (Remember, you paid money for this brand new product that includes support, use it!)

Nimbus

The problem here is that you need a top-level coco image. Since it has โ€œroutinesโ€, you need to require them directly, so perhaps the dependency 'Nimbus/Core' . You can see the full list of them here (see s.subspec )

+4
source

A compilation error about the -no-64-bit flag is due to the use of RubyMotion on Snow Leopard. update /Library/RubyMotion/lib/motion/project/vendor.rb for https://gist.github.com/2597428

The error was confirmed by Laurent Sansonetti:

Hi,

Thanks for the report! The problem is that the -no-64-bit flag has been added to Lion and you seem to be using Snow Leopard. We will get it fixed.

Laurent

+1
source

Source: https://habr.com/ru/post/1410984/


All Articles