问题描述
我尝试开发Android设备上自动测试。
我用的葫芦和Ruby on Rails,2.1.2版
I try develop automatic test on Android device.I use Calabash and Ruby on Rails, version 2.1.2
我执行命令:
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
这之后,我得到错误:
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>'
我用真实的设备 - 三星Galaxy Tab 2 7采用Android 4.1.1
I use real device - Samsung Galaxy Tab 2 7" with Android 4.1.1
什么是错的?
推荐答案
这是因为RVM设置IRBRC变量红宝石控制台。它的工作原理,如果你取消设置IRBRC值开前葫芦控制台
This is because rvm set IRBRC variable to ruby console . it works if you unset the IRBRC value before opening calabash-console
请执行以下步骤:
$取消设置IRBRC
$unset IRBRC
$葫芦,机器人控制台aplikacja.apk -p平板电脑
$calabash-android console aplikacja.apk -p tablet
$ start_test_server_in_background
$start_test_server_in_background
后下
这篇关于未定义局部变量或方法`start_test_server_in_background'主:对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!