3

I try develop automatic test on Android device. I use Calabash and Ruby on Rails, version 2.1.2

I execute command:

calabash-android console aplikacja.apk -p tablet

After this I execute command in console:

/home/maciek/.rvm/gems/ruby-2.1.2/gems/bundler-1.6.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /home/maciek/.rvm/gems/ruby-2.1.2 in PATH, mode 040777
/home/maciek/.rvm/gems/ruby-2.1.2/gems/bundler-1.6.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /home/maciek/.rvm/gems/ruby-2.1.2 in PATH, mode 040777
2.1.2 :001 >start_test_server_in_background

After this I get error:

NameError: undefined local variable or method `start_test_server_in_background' for main:Object
    from (irb):1
    from /home/maciek/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'

I use real device - Samsung Galaxy Tab 2 7" with Android 4.1.1

What is wrong?

user3610830
  • 41
  • 1
  • 4

3 Answers3

1

First thing to try — execute unset IRBRC in console and only after launch Calabash.

Second one is to use Ruby version below 2.0 — e.g. 1.9.3.

There are several issues when running with Ruby 2.0. Few proofs:

I've seen the same behavior myself, version downgrade/upgrade helps. But it looks like it relates to calabash-android only.

Community
  • 1
  • 1
  • Why would the ruby version matter? – jmoody Jul 01 '14 at 01:32
  • There are several issues related to the usage of Ruby 2.0 with calabash. I can find several links proving that if you'd like. – Dmitry Cheremushkin Jul 01 '14 at 05:34
  • Please do provide the links. I haven't seen any problems related to ruby 2.* and calabash-ios. I do periodic regression tests on the supported ruby versions. We have had some suspicious behavior with rvm users though. This is the first I have heard about a systemic problem with ruby 2.*. The calabash-ios/android team primarily uses rbenv. – jmoody Jul 02 '14 at 00:13
  • I have a question. Have you tried to execute 'unset IRBRC' in console and then launch calabash? – Dmitry Cheremushkin Jul 02 '14 at 04:17
1

This is because rvm set IRBRC variable to ruby console . it works if you unset the IRBRC value before opening calabash-console

Please do the following steps :

$unset IRBRC

$calabash-android console aplikacja.apk -p tablet

$start_test_server_in_background

post your comment below

Mesh
  • 193
  • 1
  • 7
0

I suspect the problem is this:

https://github.com/calabash/calabash-android/pull/383

I think you can do this to work around this problem.

$ IRBRC= calabash-android console aplikacja.apk -p tablet

jmoody
  • 2,480
  • 1
  • 16
  • 22