Ruby test code doesn't run, i2c-devices library problem?
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 494
- Forks
- 472
- PR merge metrics
- No merged PRs in 30d
Description
I installed the repo tonight, flashed the firmware, all of it said it was successful.
I updated the script to use D2 since I already had a grove temperature sensor plugged in there, but I'm getting this error:
~/Dexter/GrovePi/Software/Ruby/tests $ ruby test_read_digital.rb
Traceback (most recent call last):
11: from test_read_digital.rb:3:in `<main>'
10: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
9: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
8: from /home/pi/Dexter/GrovePi/Software/Ruby/grove_pi.rb:3:in `<top (required)>'
7: from /home/pi/Dexter/GrovePi/Software/Ruby/grove_pi.rb:5:in `<module:GrovePi>'
6: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in `require'
5: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
4: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `require'
3: from /var/lib/gems/2.5.0/gems/i2c-devices-0.0.6/lib/i2c/driver/i2c-dev.rb:3:in `<top (required)>'
2: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/var/lib/gems/2.5.0/gems/i2c-devices-0.0.6/lib/i2c/driver.rb:5:in `<top (required)>': uninitialized constant I2CDevice (NameError)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Software/Ruby/tests/test_read_digital.rb and the require statements in Software/Ruby/grove_pi.rb, then compare them with the reported i2c-devices stack trace. Reproduce the command on the Raspberry Pi; done means the Ruby test starts without the I2CDevice NameError and reaches its sensor-reading behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- raspberry-pi, ruby
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100