Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project.open fails in ruby 2.3.0 #438

Closed
kiprobinson opened this issue Oct 31, 2016 · 6 comments
Closed

Project.open fails in ruby 2.3.0 #438

kiprobinson opened this issue Oct 31, 2016 · 6 comments

Comments

@kiprobinson
Copy link

I just updated Ruby on OSX (brew install ruby).

$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

Now when I call Project.open, I am getting errors.

Here is my script:

#!/usr/bin/env ruby
require 'xcodeproj'

xcproj = Xcodeproj::Project.open("platforms/ios/My Project.xcodeproj")
xcproj.recreate_user_schemes
xcproj.save

And here is the error I am getting:

/usr/local/lib/ruby/gems/2.3.0/gems/nanaimo-0.1.2/lib/nanaimo/reader.rb:251:in `raise_parser_error': Dictionary ({#<Nanaimo::String:0x007f8dc2ae3470 @value="isa", @annotation="">=>#<Nanaimo::String:0x007f8dc2ae3420 @value="PBXFileReference", @annotation="">, #<Nanaimo::String:0x007f8dc2ae33d0 @value="fileEncoding", @annotation="">=>#<Nanaimo::String:0x007f8dc2ae3380 @value="4", @annotation="">, #<Nanaimo::String:0x007f8dc2ae3330 @value="lastKnownFileType", @annotation="">=>#<Nanaimo::String:0x007f8dc2ae32e0 @value="text.xcconfig", @annotation="">, #<Nanaimo::String:0x007f8dc2ae3268 @value="name", @annotation="">=>#<Nanaimo::QuotedString:0x007f8dc2ae2f70 @value="build-debug.xcconfig", @annotation="">, #<Nanaimo::String:0x007f8dc2ae2ef8 @value="path", @annotation="">=>#<Nanaimo::String:0x007f8dc2ae2ea8 @value="cordova/build", @annotation="">}) missing ';' after key-value pair (<Nanaimo::String path> = <Nanaimo::String cordova/build>) at index 8490 (got -) (Nanaimo::Reader::ParseError)
	from /usr/local/lib/ruby/gems/2.3.0/gems/nanaimo-0.1.2/lib/nanaimo/reader.rb:165:in `parse_dictionary'
	from /usr/local/lib/ruby/gems/2.3.0/gems/nanaimo-0.1.2/lib/nanaimo/reader.rb:98:in `parse_object'
	from /usr/local/lib/ruby/gems/2.3.0/gems/nanaimo-0.1.2/lib/nanaimo/reader.rb:159:in `parse_dictionary'
	from /usr/local/lib/ruby/gems/2.3.0/gems/nanaimo-0.1.2/lib/nanaimo/reader.rb:98:in `parse_object'
	from /usr/local/lib/ruby/gems/2.3.0/gems/nanaimo-0.1.2/lib/nanaimo/reader.rb:159:in `parse_dictionary'
	from /usr/local/lib/ruby/gems/2.3.0/gems/nanaimo-0.1.2/lib/nanaimo/reader.rb:98:in `parse_object'
	from /usr/local/lib/ruby/gems/2.3.0/gems/nanaimo-0.1.2/lib/nanaimo/reader.rb:73:in `parse!'
	from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/plist.rb:27:in `read_from_path'
	from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:200:in `initialize_from_file'
	from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:102:in `open'
	from hooks/fix_xcode_schemes.rb:4:in `<main>'

I tried sudo gem update xcodeproj but it said I was already on latest version.

@kiprobinson
Copy link
Author

Actually I think this might be a problem with my .xcodeproj file. After going through this crazy workaround through the XCode UI, the above script will again work correctly.

But it is a project that opens with XCode UI, but not through Xcodeproj.

@segiddins
Copy link
Member

Please share the project

@kiprobinson
Copy link
Author

I'm sorry it's not an open source project so I cannot share publicly. If there is a way for me to share privately I can do that.

@segiddins
Copy link
Member

If you can't share that particular project, please make another project that reproduces the issue.

@kiprobinson
Copy link
Author

I just sent an email to the address listed on your GitHub profile. Let me know if you need any other information.

@kiprobinson
Copy link
Author

working now. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants