Closed holgersindbaek closed 11 years ago
Does declaring app.detect_dependencies = false
fix the error?
That seems to break other stuff, like including modules in files. What do you think I should do?
All the best
Holger Sindbaek Holgersindbaek.com (http://Holgersindbaek.com)
Co-founder Uninkd.com (http://Uninkd.com) Meer.li (http://Meer.li)
On Friday, June 21, 2013 at 4:41 PM, Clay Allsopp wrote:
Does declaring app.detect_dependencies = false fix the error?
— Reply to this email directly or view it on GitHub (https://github.com/clayallsopp/afmotion/issues/18#issuecomment-19839498).
Should I not detect dependencies and do it all manually with your other gem (motion require, I think it was called)?
@clayallsopp What do you say Clay. How can I help troubleshoot this one?
I've added support for a new RubyMotion feature with 3a4883c33161f5f7a3d459aea34d90eb7b514e9e; this should make it work without a global detect_dependencies = false
.
This feature isn't pushed to a general release yet, so you'll have to clone the RubyMotion master branch and set a RUBYMOTION_LIB
environment variable:
$ cd YourPorject
$ RUBYMOTION_LIB=~/your_git_repos/RubyMotion/lib rake
let me know how it goes
I'm ended up installing from this master git branch and things worked. I didn't have to set the environment variable.
Thanks for the help.
I am getting a funny warning when I bundle though, but things are working in spite of it:
https://github.com/clayallsopp/afmotion.git (at master) is not checked out. Please run `bundle install`
I've run 'bundle install' a hundred times, but things don't seem to be working.
Im getting a similar
uninitialized constant AFMotion::JSON::AFJSONParameterEncoding (NameError)
ive tried app.detect_dependencies = false and that does not seem to fix it
Are you sure you don't have an explicit dependency that is being missed? I had a similar problem with my code interacting with Formotion recently (when I was building a gem to be included in another project), and I ended up having to add this kind of thing to the top-level include file for the gem:
require "my-gem/version" require 'bubble-wrap/all' require 'cocoapods' require 'motion-cocoapods' require 'formotion' require 'elevate' require 'motion-pixate' require 'ib'
unless defined?(Motion::Project::Config) raise "This file must be required within a RubyMotion project Rakefile." end
Motion::Project::App.setup do |app|
app.resourcesdirs << File.join(File.dirname(FILE), '../resources') app.files += Dir.glob(File.join(File.dirname(FILE), 'my-gem/*/_.rb'))
custom_dependencies = [ [ 'my-gem/dir/dir/depends_on_string_row1.rb', 'formotion/row_type/string_row.rb' ], [ 'my-gem/dir/dir/depends_on_string_row2.rb', 'formotion/row_type/string_row.rb' ] ] custom_dependencies.each do |dep| from = app.files.select {|f| f.match(dep[0]) }.first to = app.files.select {|f| f.match(dep[1]) }.first app.files_dependencies(from => to) end
end
This was necessary because RM compiles the file in "operating system" order, and if you have a class that depends on something in an included gem, you've got to make sure that your class gets included and compiled after the dependent file form the gem.
Whenever I have an explicit dependency in my project, I just add it to the custom_dependencies array as per the above.
Which works a treat. Unless you spell the filename incorrectly … :)
On 21/08/2013, at 10:04 AM, Vidal Graupera notifications@github.com wrote:
Im getting a similar
uninitialized constant AFMotion::JSON::AFJSONParameterEncoding (NameError)
ive tried app.detect_dependencies = false and that does not seem to fix it
— Reply to this email directly or view it on GitHub.
i'm having the same problem now... since yesterday :(
uninitialized constant AFMotion::JSON::AFJSONParameterEncoding (NameError)
I wonder if this is a bug with rubymotion itself...?
I've actually stopped using afmotion for now and switched to BW:HTTP because of random errors like these that I dont know how to resolve.
i think is not a AFMotion problem, in other projects it works perfect.
maybe is something about cache and RM compilations issues, because i just clone my own github repository again and now is working ... like magic.
i can't really understand why, but it's ok again :$
i agree with u. i also think its probably not anything to due with afmotion itself, but when it stops working randomly due to these constants not being found in RM its hard to continue working
For any folks having this issue, please try using gem "afmotion", "~> 2.0.0.rc1"
: http://rubygems.org/gems/afmotion/versions/2.0.0.rc1
Open a new issue if that still causes problems
in my first compilation with 2.0.0.rc1: uninitialized constant AFMotion::ClientDSL::AFJSONRequestSerializer (NameError)
On Wed, Oct 23, 2013 at 1:27 AM, Clay Allsopp notifications@github.comwrote:
For any folks having this issue, please try using gem "afmotion", "~> 2.0.0.rc1": http://rubygems.org/gems/afmotion/versions/2.0.0.rc1
Open a new issue if that still causes problems
— Reply to this email directly or view it on GitHubhttps://github.com/usepropeller/afmotion/issues/18#issuecomment-26863422 .
rake clean:all
, rake pod:install
, rake
, and
seeing if the error persists?On Wed, Oct 23, 2013 at 3:22 AM, nacho rapallo notifications@github.comwrote:
in my first compilation with 2.0.0.rc1: uninitialized constant AFMotion::ClientDSL::AFJSONRequestSerializer (NameError)
On Wed, Oct 23, 2013 at 1:27 AM, Clay Allsopp notifications@github.comwrote:
For any folks having this issue, please try using gem "afmotion", "~> 2.0.0.rc1": http://rubygems.org/gems/afmotion/versions/2.0.0.rc1
Open a new issue if that still causes problems
— Reply to this email directly or view it on GitHub< https://github.com/usepropeller/afmotion/issues/18#issuecomment-26863422> .
nacho
— Reply to this email directly or view it on GitHubhttps://github.com/usepropeller/afmotion/issues/18#issuecomment-26894210 .
now it's solved and working. i had a problem with my configuration and cache compilation.
thanks for your work ;)
On Wed, Oct 23, 2013 at 7:00 PM, Clay Allsopp notifications@github.comwrote:
- can you confirm in your Podfile.lock that AFNetworking 2.0 is being loaded, not AFNetworking 1.x?
- can you try doing
rake clean:all
,rake pod:install
,rake
, and seeing if the error persists?On Wed, Oct 23, 2013 at 3:22 AM, nacho rapallo notifications@github.comwrote:
in my first compilation with 2.0.0.rc1: uninitialized constant AFMotion::ClientDSL::AFJSONRequestSerializer (NameError)
On Wed, Oct 23, 2013 at 1:27 AM, Clay Allsopp notifications@github.comwrote:
For any folks having this issue, please try using gem "afmotion", "~> 2.0.0.rc1": http://rubygems.org/gems/afmotion/versions/2.0.0.rc1
Open a new issue if that still causes problems
— Reply to this email directly or view it on GitHub< https://github.com/usepropeller/afmotion/issues/18#issuecomment-26863422>
.
nacho
— Reply to this email directly or view it on GitHub< https://github.com/usepropeller/afmotion/issues/18#issuecomment-26894210> .
— Reply to this email directly or view it on GitHubhttps://github.com/usepropeller/afmotion/issues/18#issuecomment-26922932 .
I'm getting this error in my project. I think it is the same error as this one - https://github.com/clayallsopp/afmotion/issues/10.
If I run the sample project, then I can use afmotion with no problem, but it doesn't work in my project. I don't know if it's a gem conflict or what it is, but I really hope there's some sort of solution to this problem.
This is the error I get:
Gemfile:
Rakefile:
intro_controller.rb: