Ruby rspec 命令不起作用可能是因为 Ubuntu 12 是 64 位? [英] Ruby rspec command not working could it be because Ubuntu 12 is 64 bit?

查看:27
本文介绍了Ruby rspec 命令不起作用可能是因为 Ubuntu 12 是 64 位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题让我很头疼.我目前正在处理一项要求我在 ruby​​ 上使用 rspec 的作业.每当我运行 rspec 命令时,我都会收到诸如

I've had lots of headaches on this issue. I'm currently working on an assignment that requires me to use rspec on ruby. Whenever I run the rspec command I keep getting errors like

home/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/core/configuration.rb:780:in 'load': 无法加载此类文件来回,home/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in 'map'....

home/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/core/configuration.rb:780:in 'load': cannot load such file fro, home/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in 'map'....

它们只是无穷无尽且令人困惑.我想我在我的 .rb 文件中没有做正确的事情,无论我如何根据相同问题的测试规则进行调整.我想我会从一个基本的 rspec 教程示例从头开始,但仍然遇到相同的错误.我觉得这可能是我的 ruby​​ 安装,所以我卸载了,这次我使用 RVM 安装 - 仍然出现相同的错误.无论我尝试什么 - 简单的测试代码(假设我的作业可能有问题),我都尝试过 rspec、rspec spec、rake spec,结果仍然相同.

They're just endless and confusing. I figure I wasn't doing something right in my .rb files no matter how I tweak according to the test rules same issue. I figured I'd start from scratch with a basic rspec tutorial example, still getting the same errors. I felt it might be my ruby installation so I uninstalled and this time I installed using RVM - still the same errors I get. No matter what I try - simple test codes (assuming maybe my assignment one is buggy), I've tried rspec, rspec spec, rake spec, still the same results.

我真的很困惑.我是 ruby​​ 的新手,我的任务将在几天后到期.我知道如何编写获得所需结果所需的代码,但我一直被限制使用 rspec,这真的很烦人.然后我记得有一次当我尝试用我的 64 位 Ubunutu 安装 LAMPP 时,我被告知我需要获得 32 位库或其他东西,我做到了并且 LAMPP 现在可以工作(虽然我不能使用 myphp admin).所以我在想,是不是我需要获得 32 位版本的 Ubuntu 12?这是否与我的 rspec 问题有关,或者我只是做错了什么?

I'm really confused. I'm new to ruby and my assignment is due in a few days. I have an idea how to write the code I need to get the required results but I have been restricted to use rspec which is really annoying. Then I remembered once when I tried to install LAMPP with my 64 bit Ubunutu and I was told I need to get 32 bit libraries or something, which I did and LAMPP now works (I can't use myphp admin though). So I'm thinking, could it be that I need to get a 32 bit version of Ubuntu 12 instead? Does it have anything to do with my rspec problem or I'm just doing something else wrong?

哦,是的,我安装了 ruby​​ gem.您的回答将不胜感激.

Oh and yes, I have ruby gems installed. Your answers would be really appreciated guys.

推荐答案

1.) 删除你的 Gemfile.lock 文件

1.) delete your Gemfile.lock file

2.) 运行 bundle install 如果你想排除任何使用 --without 标志例如:bundle install --without production

2.) run bundle install if you want to exclude anything use the --without flag ex: bundle install --without production

3.) 运行 bundle exec rspec spec/

现在应该可以正常工作了.让我知道.

This should make it work now. Let me know.

这篇关于Ruby rspec 命令不起作用可能是因为 Ubuntu 12 是 64 位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆