9

I am trying to build a Simple RubyMotion app so that i can transfer it on my iPhone.

I executed rake build:device

    Ankits-MacBook-Pro:hello ankitgupta$ rake build:device
    Build ./build/iPhoneOS-6.0-Development
    Create ./build/iPhoneOS-6.0-Development/hello.app/embedded.mobileprovision
    ERROR! Can't find a provisioning profile named `(?-mix:iOS Team Provisioning Profile)'

Any idea on this error?

AnkitG
  • 6,438
  • 7
  • 44
  • 72

3 Answers3

16

According to the RubyMotion forum post by @RayHightower here:

https://groups.google.com/forum/?fromgroups=#!topic/rubymotion/Nvo8dH_8rkI

...you should do this:

In order to successfully run a RubyMotion app on a non-jailbroken iPhone 3GS (via "rake device") I had to:

  • Delete all of the expired provisioning profiles in the Mac OS X Keychain Access app. Yeah, my past is littered with many random experiments :-)
  • Explicitly set the path to my provisioning profile in the rakefile for the app (the defaults didn't work for me).
  • Explicitly set the name of my codesign_certificate.

The default "iOS Team Profile" didn't work for me. I had to set explicit values in my rakefile for the app. Here's my rakefile for the 'Tweets' sample app at https://github.com/HipByte/RubyMotionSamples :

$:.unshift("/Library/RubyMotion/lib")
require 'motion/project' 
Motion::Project::App.setup do |app| 
  # Use `rake config' to see complete project settings. 
  app.name = 'Tweets' 
  app.provisioning_profile = '/Users/[username]/Library/MobileDevice/Provisioning Profiles/[string-of-numbers].mobileprovision' 
  app.codesign_certificate = 'iPhone Developer: John Q Developer  (A5QZ9QF4Z1)'
 end 

Of course, my name isn't "John Q Developer", but you get the idea. Hope this helps!

-@RayHightower

Jamon Holmgren
  • 23,738
  • 6
  • 59
  • 75
7

Generally speaking, I've found when something is awry with RubyMotion there is an easy fix but it usually involves Xcode and magic. Who knows if this will fix it for you (that's the magic part of Xcode), but it doesn't require any changes in your app! :)

How to Fix

  1. Open Xcode
  2. Go to 'Preferences' Step 2 Screenshot

  3. Go to the 'Accounts' tab, and click 'View Details' Step 3 Screenshot

  4. Click the 'refresh' icon, in the bottom left enter image description here

Wait for it to refresh... et voila! You should be able to compile without the error.

NOTE: The first time I clicked refresh, it erred out. I clicked the 'done' button, then repeated steps three and four.

Good luck, hopefully this helps someone else.

tehprofessor
  • 2,957
  • 1
  • 21
  • 22
  • This, then deploy a sample application with XCode, then with RubyMotion fixed it =) – Abdo Feb 23 '15 at 10:47
5

I ran into this problem too, and specifying an explicit provisioning profile was unacceptable from a team development perspective since the Rakefile is checked into git.

In order to solve this I simply created a new Provisioning Profile named: "iOS Team Provisioning Profile" which includes any devices I want to build for. Each member of your team can do the same thing, and no one has to explicitly point to a provisioning profile path like in the other answer.

If you browse the source for the RubyMotion project config at: https://github.com/HipByte/RubyMotion/blob/master/lib/motion/project/config.rb you'll notice that it'll look for a default provisioning profile named "iOS Team Provisioning Profile" (scanning each profile for that name). So as long as that remains the same, this is probably the easiest way to solve it.

I think the intent was to be able to specify a provisioning profile name in your Rakefile, instead of specifying the entire path. It should then search through each of your profiles looking for one matching the same you passed (this would be more appropriate for teams working on the same project). Unfortunately this isn't the way it currently works.

Dave Rapin
  • 1,471
  • 14
  • 18