Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seek for help #1

Closed
955xiaoSu opened this issue Sep 15, 2022 · 6 comments
Closed

Seek for help #1

955xiaoSu opened this issue Sep 15, 2022 · 6 comments

Comments

@955xiaoSu
Copy link

It's my first time to use ruby and rspec. So I always failed in runing 'rspec spec db_test.rb', this process will be killed as for outing of memory. Does ruby need some configuration before to make it run normally?

@KCNyu
Copy link
Owner

KCNyu commented Sep 15, 2022

If it's possible, could you please show me your specific error message? And also the version of ruby and respec (ruby -v && rspec -v) you are using?

@955xiaoSu
Copy link
Author

If it's possible, could you please show me your specific error message? And also the version of ruby and respec (ruby -v && rspec -v) you are using?

After some attemption, my error message became another one like this:
屏幕截图 2022-09-16 124903
Search it on google, I guess that meybe ruby require some prefix configuration like file path and so on.
Anyway it still make me confuszed. My ruby verision is 2.7.4p191 and rspec version is 3.9.

@KCNyu
Copy link
Owner

KCNyu commented Sep 16, 2022

Maybe you can try to just use rspec db_test.rb or rspec ./db_test.rb.

@955xiaoSu
Copy link
Author

Maybe you can try to just use rspec db_test.rb or rspec ./db_test.rb.

Unfortunately, I still failed this time with error An error occurred while loading spec_helper. Failure / Error: return gem_original_require(path). Accoriding to an answer in StackOverFlow, I enter rspec --init command and then I get a subfolder spec. Then I copy the file db_test.rb to spec folder, enter rspec ./spec/db_test.rb command. This time, error message became Failure / Error: config.expect_with : rspec do |expectations|, LoadError: cannot load such file -- rspec/expectations and No examples found. That's the situation I meet right now. Could you help me fix this problem?

@KCNyu
Copy link
Owner

KCNyu commented Sep 16, 2022

Not quite sure, but maybe you can try to do by the following steps:

  1. cd tutorial01
  2. g++ db.cpp -o db
  3. rspec --init && cp db spec
  4. cp db_test.rb spec/main_spec.rb
  5. rspec spec

@955xiaoSu
Copy link
Author

Not quite sure, but maybe you can try to do by follow steps:

  1. cd tutorial01
  2. g++ db.cpp -o db
  3. rspec --init && cp db spec
  4. cp db_test.rb spec/main_spec.rb
  5. rspec spec

I really appreciate your help! Now I have fixed this problem. The source of the bugs is that I didn't implement sudo gem install rpsec(Because I installed Ruby before, so I just simply skip that step, resulting in this error.)

@KCNyu KCNyu closed this as completed Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants