我按照以下步骤操作并尝试安装calabash。
https://github.com/calabash/calabash-ios
但是当我运行命令 calabash-ios setup 时出现以下错误。
$ calabash-ios setup
~/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in
`to_specs': Could not find 'calabash-cucumber' (>= 0) among 7 total gem(s) (Gem::LoadError).
尝试了一些我在下面提到的命令
$ which cucumber
~/.rvm/rubies/ruby-1.9.3-p484/bin/cucumber
$ gem list
bundler (1.5.2)
bundler-unload (1.0.2)
executable-hooks (1.3.1)
gem-wrappers (1.2.4)
rake (10.1.1)
rubygems-bundler (1.4.2)
rvm (1.11.3.8)
$ which -a ruby
~/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
/usr/bin/ruby
$ ruby gem
ruby: No such file or directory -- gem (LoadError)
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.1
- RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86_64-darwin12.5.0]
- INSTALLATION DIRECTORY:(HomeDirectory)/.rvm/gems/ruby-1.9.3-p484
- RUBY EXECUTABLE:(HomeDirectory)/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
- EXECUTABLE DIRECTORY:(HomeDirectory)/.rvm/gems/ruby-1.9.3-p484/bin
- SPEC CACHE DIRECTORY:(HomeDirectory)/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
-(HomeDirectory)/.rvm/gems/ruby-1.9.3-p484
-(HomeDirectory)/.rvm/gems/ruby-1.9.3-p484@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- ~/.rvm/gems/ruby-1.9.3-p484/bin
- ~/.rvm/gems/ruby-1.9.3-p484@global/bin
- ~/.rvm/rubies/ruby-1.9.3-p484/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/bin
- ~/.rvm/bin
编辑:
$rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
~/.rvm/gems/ruby-1.9.3-p484@global/bin/ruby_executable_hooks:15:in `eval'
~/.rvm/gems/ruby-1.9.3-p484@global/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
$rake --trace
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
~/.rvm/gems/ruby-1.9.3-p484@global/gems/rake-10.1.1/lib/rake/application.rb:632:in `raw_load_rakefile'
~/.rvm/gems/ruby-1.9.3-p484@global/gems/rake-10.1.1/lib/rake/application.rb:94:in `block in load_rakefile'
~/.rvm/gems/ruby-1.9.3-p484@global/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
~/.rvm/gems/ruby-1.9.3-p484@global/gems/rake-10.1.1/lib/rake/application.rb:93:in `load_rakefile'
~/.rvm/gems/ruby-1.9.3-p484@global/gems/rake-10.1.1/lib/rake/application.rb:77:in `block in run'
~/.rvm/gems/ruby-1.9.3-p484@global/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
~/.rvm/gems/ruby-1.9.3-p484@global/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
~/.rvm/gems/ruby-1.9.3-p484@global/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
~/.rvm/gems/ruby-1.9.3-p484@global/bin/rake:23:in `load'
~/.rvm/gems/ruby-1.9.3-p484@global/bin/rake:23:in `<main>'
~/.rvm/gems/ruby-1.9.3-p484@global/bin/ruby_executable_hooks:15:in `eval'
~/.rvm/gems/ruby-1.9.3-p484@global/bin/ruby_executable_hooks:15:in `<main>'
我更喜欢Ruby升级到删除。
可以请一些人帮我解决这个问题。
注意:问题中已编辑的终端输出。
答案 0 :(得分:2)
我最好的猜测是gem install calabash-cucumber
。which cucumber
只是引用黄瓜宝石中的bin而不是 calabash-cucumber 宝石
答案 1 :(得分:0)
我遇到了同样的问题,只能通过删除rvm来解决它:
rvm implode
还有一些额外的步骤:How can I remove RVM (Ruby Version Manager) from my system? 我建议在执行上述操作后重新启动终端。
从那时起,我的机器上只有Ruby 1.8。所以我使用Mac Ports更新了它:
sudo port install ruby19 +nosuffix
我建议此时再次重新启动终端。希望现在如果你运行ruby -v
,你应该会看到新版本的Ruby显示。
然后使用:
sudo gem install calabash-cucumber
然后继续设置过程。
答案 2 :(得分:0)
由于它返回无法找到calabash的消息...将 gem'calabash-cucumber'添加到您的Gemfile并捆绑安装,然后重试