Skip to content

Do not use `configs' which is used by RubyMotion internal #143

merged 1 commit into from Sep 21, 2012

8 participants


`configs' will be removed with next update (v1.24).

Rubymotion Community member

It seems like it crashes the specs:

[master ✔] ➜ rake spec output=test_unit                                                                                
rake aborted!
undefined method `setup_blocks' for #<Motion::Project::Config:0x007fd78b628f58>

(See full trace by running task with --trace)

Oh, sorry. `setup_blocks' method will be added by v1.24.
RubyMotion v1.24 is not release yet. but it will be release soon.

Rubymotion Community member

Okay sure,. Is there a way we can add a check if the RM version is >= 1.24 and based on that use the appropriate accessor?


Which one do you like?

  1. To detect version number, you could parse the Motion::Version
  2. If setup_blocks will raise exception, you would call configs's method
diff --git a/lib/bubble-wrap/ext/motion_project_app.rb b/lib/bubble-wrap/ext/motion_project_app.rb
index 28e8f24..1d303f9 100644
--- a/lib/bubble-wrap/ext/motion_project_app.rb
+++ b/lib/bubble-wrap/ext/motion_project_app.rb
@@ -11,8 +11,12 @@ module BubbleWrap
               app.frameworks = ::BubbleWrap::Requirement.frameworks(app.frameworks)
      unless block.nil?
-            configs.each_value &bw_config
-            config.validate
+            begin
+              config.setup_blocks << bw_config
+            rescue
+              configs.each_value &bw_config
+              config.validate
+            end
           alias :setup_without_bubblewrap :setup
           alias :setup :setup_with_bubblewrap
  1. New BubbleWrap version would support only RubyMotion >= 1.24

I think that No.3 is best select :)

Rubymotion Community member

I would say option 2 + a warning to the user.
Some newer RM versions had introduced some bugs, and most likely some production apps are sticked to a specific RM version (an older one).

Let's see what the others think, but for now, my suggestion would be something like:

  config.setup_blocks << bw_config
  NSLog "BW: It seems like you're running an older RubyMotion version than 1.24.
  Please run `sudo motion update` to remove this warning."
  configs.each_value &bw_config

OK. Whenever you think that anyone will not have to downgrade, you could modify it :)
I will close this request at once.

Thanks :)

@Watson1978 Watson1978 closed this Sep 20, 2012
@supermarin supermarin reopened this Sep 20, 2012
Rubymotion Community member

I'll reopen this one until we get it fixed :)

Currently, the specs are failing with the iOS6 SDK, so I can't get it tested/merged.
Will close it when we get the proper specs.

@supermarin supermarin closed this Sep 20, 2012
@supermarin supermarin reopened this Sep 20, 2012

Is this related to the error I'm getting?

I just update to the latest RubyMotion and BubbleWrap. This happens when I run rake:

undefined local variable or method `configs' for Motion::Project::App:Class
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bubble-wrap-1.1.3/lib/bubble-wrap/ext/motion_project_app.rb:14:in `setup_with_bubblewrap'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/sugarcube-0.8.2/lib/sugarcube.rb:6:in `<top (required)>'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `each'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `block in require'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
/Users/developer/Source/22Seven/ios/Rakefile:5:in `<top (required)>'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `load'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `load_rakefile'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `raw_load_rakefile'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `block in load_rakefile'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `standard_exception_handling'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `load_rakefile'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `block in run'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `standard_exception_handling'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `run'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake- `<top (required)>'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/bin/ruby_noexec_wrapper:14:in `eval'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/bin/ruby_noexec_wrapper:14:in `<main>'
Rubymotion Community member

It works fine when change

configs.each_value &bw_config


config.setup_blocks << bw_config



So that is a quickfix for anyone getting this and who still needs to work today :)


@michael-erasmus Thanks for the patch

Rubymotion Community member
dmarkow commented Sep 20, 2012

@mneorr Unfortunately, once you update to RubyMotion 1.24, the specs won't run because of this config vs configs issue (I realize that once that's fixed, there are still other issues preventing the specs from running).

I think we should push this change using the recommendation of Option 2 + a warning.

mikesax commented Sep 20, 2012

RubyMotion 1.24 fails to build projects that include BubbleWrap for me.

michael-erasmus's patch fixes it. (thanks!)

Rubymotion Community member
dmarkow commented Sep 20, 2012

Now that I think about it, I think Option 3 is actually better (just don't support < 1.24). If someone has their app locked to an older version in production, they should also have it locked to an older version of BW too. Ideally, RubyMotion would have properly deprecated the configs removal, giving users a period of time to transition and use either one.

Since RubyMotion is still very young and new, and changing all the time, supporting older versions doesn't seem to make a lot of sense. I'd hate to see BW get littered with dozens of conditional statements and/or rescue blocks (for example, @Watson1978's other pull request to add _spec to the end of the test suite name would need a conditional based on the version of RubyMotion being used).

Thoughts? I'd like to get this fixed ASAP so we can push an updated gem; in the mean time, no one can use the current BW gem on RubyMotion 1.24


@dmarkow Agreed on #3. Users should lock to a version/commit.

As more apps go into production, it'll be important too keep branches that work with a particular version of RubyMine/SDK around. Master should really only be for development work I think and should keep moving.

Rubymotion Community member
siuying commented Sep 21, 2012

I'll merge this first for that 1.24 is released.

@siuying siuying merged commit 4e75e84 into rubymotion:master Sep 21, 2012
Rubymotion Community member

@dmarkow I've posted another one on #144, the failure reason was different than this one :)

It seems like the iOS5 - 6 transition had some problems with RM compiler.
After updating RM it seems like it's working fine.

@andyw8 andyw8 referenced this pull request in clayallsopp/formotion Sep 25, 2012

Broken for RubyMotion 1.24 #37

Rubymotion Community member
siuying commented Sep 26, 2012

bubble-wrap 1.1.4 with this fix is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.