Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined local variable or method `start_test_server_in_background' for main:Object

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?

like image 478
user3610830 Avatar asked Aug 06 '26 09:08

user3610830


2 Answers

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:

  • https://github.com/calabash/calabash-android/issues/342
  • Install Calabash-Android causes error on OS X Mavericks

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

like image 130
Dmitry Cheremushkin Avatar answered Aug 08 '26 21:08

Dmitry Cheremushkin


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

like image 45
Mesh Avatar answered Aug 08 '26 22:08

Mesh