Rake fails installing apriori.rb gem on windows - ruby

Pretty straight forward:
C:\Ruby192>gem install apriori
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing apriori:
ERROR: Failed to build gem native extension.
"C:/Ruby192/bin/ruby.exe" -rubygems C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake RUBYARCHDIR=C:/Rub
y192/lib/ruby/gems/1.9.1/gems/apriori-0.2.2/lib RUBYLIBDIR=C:/Ruby192/lib/ruby/gems/1.9.1/gems/apriori-0.2.2/lib
rake aborted!
no such file to load -- config/requirements
(See full trace by running task with --trace)
Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/apriori-0.2.2 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/apriori-0.2.2/./gem_make.out
I'm new to ruby and gems, but if I got it right the one complaining is the RakeFile:
require 'config/requirements'
require 'config/hoe' # setup Hoe + all gem configuration
But the file is really there:
c:\Ruby192>ls -l C:/Ruby192/lib/ruby/gems/1.9.1/gems/apriori-0.2.2/config
total 2
-rw-r--r-- 1 fgadotti Administ 2877 Oct 31 14:59 hoe.rb
-rw-r--r-- 1 fgadotti Administ 655 Oct 31 14:59 requirements.rb
Could it be a problem with windows paths? For some reason preventing rake from finding the files?

Related

Jekyll: Operation not permitted # apply2files

I am using Windows 10's Linux subsystem where I installed Jekyll but when I run bundle exec jekyll serve it gives me:
jekyll 3.8.6 | Error: Operation not permitted # apply2files - /mnt/e/Work/project/_site/images/banner.jpg
I know there are some incompatibilities with Windows and Linux permissions, because all my files are owned by root for some reason, but there is a fix to this issue?
I found an answer here https://scottdorman.blog/2019/02/27/running-jekyll-on-wsl/ where the author says I have to close and reopen the bash, but it doesn't work.
These "operation not permitted" errors seem to be related to user rights or ownership.
I have seen strange errors on colleagues' MAC computers. The command ls -al showed that certain folders were owned by root.
If this applies to you, try to change/transfer ownership to your user with these commands:
sudo chmod -R 777 /mnt/e/Work/project/
sudo chown -R youruser /mnt/e/Work/project/
The difference between chmod and chown is simple:
chmod changes modes
chown changes ownership
Note: This is explained in detail on unixtutorial.org.
For the Windows Linux Subsystem, I have found this old blogpost devblogs.microsoft.com from January 2018:
How did permissions work in the past?
Prior to Build 17063, all files/folders list “root” as the owner and belonged to the group “root”. The permission bits on each file/folder was derived from Windows permissions–no write bit checked for Windows meant no write bit set in WSL.
Additionally, attempting to chmod or chown on a file/folder resulted in a no-op (they wouldn’t do anything!)
How do permissions work now?
For files that don’t have metadata, we apply the same approach as what is described in pre-17063 builds. But now, chmod/chown can assign metadata to the file or folder. Newly created files in WSL will be created with metadata by default and will respect the mount options you’ve set (discussed later) or the permissions you pass when executing a mkdir/open.
And, I have found this SO post:
chmod WSL (Bash) doesn't work, which states that it's enough to unmount and re-mount the drive to make chmod and chown work (after the mentioned WSL update).
As #Mike Cole mentioned above in the comments: If you are using wsl this can happen. I resolved this by restarting my machine and magically it works now.
The problem
This error also occoured for me on WSL. But I'm happy to have found a fix that doesn't require me to manually chmod permissions into directories. The error is verbose enough to tell me its an issue with my chmod command not allowing me to do that, rather than something I should be doing for every single folder on my system each time I want to rbenv into it to work on something like Jekyll.
ion not permitted # apply2files - /mnt/e/source/repos/work/ecs-saber/docs (Errno::EPERM)
Little research
EPERM is a validation check, a deep dive would reveal this is a safety feature that prevents you, even if you have access, from being able to do anyhting to file permissions with Ruby on directories / files that you are not a part of the group ownership on.
So how did I fix it?
I fixed it via adding WSL DrvFs speclines to my /etc/wsl.conf file (see: https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig )
The rest of this document breaks down the steps.
1. Configure your WSL root account:
You should have a root password, because you won't have access to /etc, even with your user's sudo command, so first:
me#PRIVATE-PC:/mnt/c/Users/private$ sudo passwd
[sudo] password for me:
New password:
Retype new password:
passwd: password updated successfully
Now login as root
su -
Password:
Welcome to Ubuntu 20.04.5 LTS (GNU/Linux *.*.*.*-microsoft-standard-WSL2 x86_64)
...
This message is shown once a day. To disable it please create the
/root/.hushlogin file.
root#PRIVATE-PC:~# _
Now, good little admins should also harden their root accounts, but this isn't the scope of this answer. You can move forward for now, but you should go back and do this. I am obligated to tell you that about root access, anywhere, at any time (that includes at 3AM, Junior Devs, where the greatest mistakes happen with the root shell is when we are tired)
Put a string on your finger to harden root shell -- Circulation is important, don't actually do this physically, I need you to keep your fingers.
2. Apply /etc/wsl.conf change
Now that you are root, you can give the /etc partiiton the fix:
Write /etc/wsl.conf, just copy/paste on command line and press [enter]:
cat <<'EOF' > /etc/wsl.conf
[automount]
enabled = true
root = /mnt
options = "metadata,uid=1000,gid=1000,umask=022,case=off"
mountFsTab = false
EOF
Why umask=022 ?
Octal permissions to exclude (octal subtract) from files and directories. This produces a permission set of 0755 where your user has the ability to read, write, and execute, but your overlaying group and everyone can only read and execute.
3. Restarting without rebooting
Now, do a flip. (Simulate a restart of WSL) See: https://superuser.com/questions/1126721/rebooting-ubuntu-on-windows-without-rebooting-windows
I'll improve the solution presented by saying you don't have to reboot, if you know the right commands.
root#PRIVATE-PC:~# exit
logout
me#PRIVATE-PC:/mnt/c/Users/private$ exit
ohmyPOSH> wsl -d Ubuntu-20.04 --shutdown
ohmyPOSH> wsl -t Ubuntu-20.04
ohmyPOSH> Restart-Service LxssManager
Just count to ten in your head (Microsoft's stated rule is 8 seconds), get up have a stretch, then log back in via Windows Terminal PowerShell tab:
ohmyPOSH> wsl -d Ubuntu-20.04 -u me
Check the permissions on your jekyll project folder:
me#PRIVATE-PC:/mnt/c/users/me$ cd /mnt/e/source/repos/work/ecs-saber/docs
me#PRIVATE-PC:/mnt/e/source/repos/work/ecs-saber/docs$ ls -lah
drwxr-xr-x 1 me me 4.0K Sep 1 04:20 .
drwxr-xr-x 1 me me 4.0K Sep 1 03:49 ..
-rwxr-xr-x 1 me me 56 Sep 1 04:20 .gitignore
-rwxr-xr-x 1 me me 6 Sep 1 03:50 .ruby-version
-rwxr-xr-x 1 me me 419 Sep 1 04:20 404.html
-rwxr-xr-x 1 me me 2.1K Sep 1 04:20 _config.yml
drwxr-xr-x 1 me me 4.0K Sep 1 04:20 _posts
And now they are owned by your user with permissions set to a much less unnerving 0755! You no longer have to do this for every single directory, in fact, if you check others, like your user folder:
me#PRIVATE-PC:/mnt/c/users/me$ ls -lah
drwxr-xr-x 1 me me 512 Sep 1 03:59 .
drwxr-xr-x 1 me me 512 Aug 28 04:45 ..
drwxr-xr-x 1 me me 512 Aug 30 07:08 .aws
drwxr-xr-x 1 me me 512 Aug 30 07:08 .azure
drwxr-xr-x 1 me me 512 Aug 30 10:03 .cache
drwxr-xr-x 1 me me 512 Aug 30 09:53 .conda
-rwxr-xr-x 1 me me 4 Aug 31 07:32 .condarc
drwxr-xr-x 1 me me 512 Aug 28 12:19 .docker
...
You'll have a lot of the same.
Onward
me#PRIVATE-PC:/mnt/e/source/repos/work/ecs-saber/docs$ jekyll new . --force
Running bundle install in /mnt/e/source/repos/work/ecs-saber/docs...
Bundler: Fetching gem metadata from https://rubygems.org/............
Bundler: Resolving dependencies...
Bundler: Using public_suffix 5.0.0
Bundler: Using bundler 2.3.21
Bundler: Using colorator 1.1.0
Bundler: Using concurrent-ruby 1.1.10
Bundler: Using eventmachine 1.2.7
Bundler: Using http_parser.rb 0.8.0
Bundler: Using ffi 1.15.5
Bundler: Using forwardable-extended 2.6.0
Bundler: Using rexml 3.2.5
Bundler: Using rb-fsevent 0.11.2
Bundler: Using liquid 4.0.3
Bundler: Using mercenary 0.4.0
Bundler: Using rouge 3.30.0
Bundler: Using unicode-display_width 1.8.0
Bundler: Using safe_yaml 1.0.5
Bundler: Using addressable 2.8.1
Bundler: Using i18n 1.12.0
Bundler: Using sassc 2.4.0
Bundler: Using rb-inotify 0.10.1
Bundler: Using pathutil 0.16.2
Bundler: Using em-websocket 0.5.3
Bundler: Using terminal-table 2.0.0
Bundler: Using jekyll-sass-converter 2.2.0
Bundler: Using kramdown 2.4.0
Bundler: Using listen 3.7.1
Bundler: Using kramdown-parser-gfm 1.1.0
Bundler: Using jekyll-watch 2.2.1
Bundler: Using jekyll 4.2.2
Bundler: Fetching jekyll-seo-tag 2.8.0
Bundler: Fetching jekyll-feed 0.16.0
Bundler: Installing jekyll-feed 0.16.0
Bundler: Installing jekyll-seo-tag 2.8.0
Bundler: Fetching minima 2.5.1
Bundler: Installing minima 2.5.1
Bundler: Bundle complete! 7 Gemfile dependencies, 31 gems now installed.
Bundler: Use `bundle info [gemname]` to see where a bundled gem is installed.
New jekyll site installed in /mnt/e/source/repos/work/ecs-saber/docs
🎉 No more EPERM validation failures.

ruby.h library(ies) not found despite make check success; when building redmine

So I am installing Redmine and after installing all the prerequisites, the next step was (my home is /home/sbh/)
/home/sbh/SW/Ruby/dev/execprefix/bin/bundle install --path vendor/bundle --without development test
which resulted in (several) erros such as;
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.4.0
/gems/sqlite3-1.3.11/ext/sqlite3
/home/sbh/SW/Ruby/dev/execprefix/bin/ruby -r
./siteconf20160904-12703-1l1dktl.rb extconf.rb
mkmf.rb can't find header files for ruby at /home/sbh/SW/Ruby
/dev/execprefix/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /home/sbh/SW/Redmine/redmine/vendor
/bundle/ruby/2.4.0/gems/sqlite3-1.3.11 for inspection.
Results logged to /home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.4.0
/extensions/x86_64-linux/2.4.0-static/sqlite3-1.3.11/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
(I use vendor/bundle because I'm trying to keep the Ruby stuff dealing with redmine local - if I understand gem help install correctly) So I try this;
sbh#sbh-laptop-M18 ~/SW/Redmine/redmine $ /home/sbh/SW/Ruby
/dev/execprefix/bin/gem install json -v '1.8.3'
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
current directory: /home/sbh/SW/Ruby/dev/execprefix/lib/ruby/gems/2.4.0
/gems/json-1.8.3/ext/json/ext/generator
/home/sbh/SW/Ruby/dev/execprefix/bin/ruby -r
./siteconf20160904-13928-17xfuw8.rb extconf.rb
mkmf.rb can't find header files for ruby at /home/sbh/SW/Ruby
/dev/execprefix/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /home/sbh/SW/Ruby/dev/execprefix
/lib/ruby/gems/2.4.0/gems/json-1.8.3 for inspection.
Results logged to /home/sbh/SW/Ruby/dev/execprefix/lib/ruby/gems/2.4.0
/extensions/x86_64-linux/2.4.0-static/json-1.8.3/gem_make.out
I did check that that location is not good, even the lowest folder doesn't exist, i.e. (no /include/);
sbh#sbh-MacBookPro ~ $ ls /home/sbh/SW/Ruby/dev/execprefix/lib/ruby/
2.4.0 gems site_ruby vendor_ruby
Also the make check succeeded in the build of Ruby from the svn (I understand this to be the dev branch and so I don't see why I would need to apt-get install any ruby-devs);
svn co https://svn.ruby-lang.org/repos/ruby/trunk ruby
So I did this;
find . -name ruby.h -print -exec ls -Alrt {} \;
resulting in four files;
sbh#sbh-laptop-M18 ~/SW/Ruby $ find . -name ruby.h -print -exec ls
-Alrt {} \;
./dev/ruby/include/ruby.h
-rw-r--r-- 1 sbh sbh 868 Sep 4 20:29 ./dev/ruby/include/ruby.h
./dev/ruby/include/ruby/ruby.h
-rw-r--r-- 1 sbh sbh 77600 Sep 4 20:29 ./dev/ruby/include/ruby/ruby.h
./dev/prefix/include/ruby-2.4.0/ruby.h
-rw-r--r-- 1 sbh sbh 868 Sep 4 20:29 ./dev/prefix/include/ruby-
2.4.0/ruby.h
./dev/prefix/include/ruby-2.4.0/ruby/ruby.h
-rw-r--r-- 1 sbh sbh 77600 Sep 4 20:29 ./dev/prefix/include/ruby-
2.4.0/ruby/ruby.h
I don't know why there are four, or two judging by the size, though I don't see them as links...(?) So I added to ~/.profile, at the bottom;
export LD_LIBRARY_PATH=/home/sbh/SW/Ruby/dev/prefix/include/ruby-
2.4.0/ruby/
export LD_LIBRARY_PATH=/home/sbh/SW/Ruby/dev/ruby/include/ruby/
and then ran sudo ldconfig and source ~/.profile. But it still didn't work after closing out terminal and starting it again.
Internet resulted in these ideas;
Error while installing json gem 'mkmf.rb can't find header files for ruby',
nokogiri will not install - ERROR: Failed to build gem native extension,
`require': no such file to load -- mkmf (LoadError)
but they all seem to want the OP to sudo apt-get install ruby-dev, and I only want to work off my 'local tree' - so no apt-get.
Shouldn't this be super simple? Or does Redmine somehow expect a certain path for these header files? Something maybe hardcoded for a default Ruby install?
Any ideas?
P.S. I want a 'local' build of Ruby much like Anaconda/Python...
P.P.S. I also realize that I could also use apt-get to only download the package to the archive, then use either dpkg or ar to extract the files, and then move them somewhere into my Ruby installation (I suppose a path too), but without adding any new PPAs, my default sources only cover up to ruby2.3-dev and my svn pulled 2.4. I don't know if there is any difference but I don't see why I can't get everything from ruby-lang.org...
P.P.P.S. When building Ruby, I put everything here;
./configure --prefix=/home/sbh/SW/Ruby/dev/prefix
--exec-prefix=/home/sbh/SW/Ruby/dev/execprefix
--oldincludedir=/home/sbh/SW/Ruby/dev/oldincludedir
You're using the new-and-shiny 2.4.0.
It recently got a "unified Integer type", which combined BigDecimal and Fixnum into Integer.
Your project relies on the json rubygem, which is also a C-based extension. The json gem v1.8.3 doesn't know about the new way of handling numbers.
Here's how to demand a newer version of the json gem:
In your Gemfile, add:
gem 'json', '~> 2.0', '>= 2.0.2'
(That can be read as "at least the 2.0.x series", and also "at least 2.0.2".)
Hope this helps!
PS: Here is a typical patch which updates a C-based extension to this new way of handling numbers.
PPS: A workaround is to use ruby-build and build yourself a Ruby 2.3.1, which will support the gem versions that Redmine would install by default.

native gem installs fine on 1.9.3 but fails on 2.0.0

A private gem with native extensions I have that had worked fine since ruby 1.8.2 and then 1.9.3 is now failing in a wird mode to install on ruby 2.0.0. Instead of installing the required shared object .so file, it copies an executable. There are not changes to the gem sources, going back to ruby 1.9.3 (and it's gemset) works fine.
Here is the relevant 2.0.0-p0 verbose output from gem install:
linking shared-object mygem/mygem.so
make install
/usr/bin/install -c -m 0755 mygem.so /home/remus/.rvm/gems/ruby-2.0.0-p0/gems/mygem-0.1.12/lib/mygem
installing default mygem libraries
Successfully installed mygem-0.1.12
...
1 gem installed
And these are the artifacts installed:
$ ls -al
total 2252
-rwxr-xr-x 1 remus remus 2289443 May 4 13:08 mygem
-rw-rw-r-- 1 remus remus 62 May 4 13:08 mygem.rb
For comparison the 1.9.3-p194 output is:
linking shared-object mygem/mygem.so
make install
/usr/bin/install -c -m 0755 mygem.so /home/remus/.rvm/gems/ruby-1.9.3-p194/gems/mygem-0.1.12/lib/mygem
installing default mygem libraries
Successfully installed mygem-0.1.12
1 gem installed
And the installed artifacts:
ls -al
total 16
drwxrwxr-x 2 remus remus 4096 May 4 13:06 mygem
-rw-rw-r-- 1 remus remus 62 May 4 13:06 mygem.rb
ls -al mygem
total 2760
-rwxr-xr-x 1 remus remus 2810959 May 4 13:06 mygem.so
ruby 2.0.0-p0: rake (10.0.4, 0.9.6), rake-compiler (0.8.3), hoe (3.6.0)
ruby 1.9.3-p194: rake (10.0.4, 10.0.3, 0.9.2.2), rake-compiler (0.8.1), hoe (3.4.0, 3.0.8)
So, without seeing your mygem.gemspec file, I can't really say for sure, but I suspect you've got the wrong files listed in there. For example, here's an abridged gemspec based on the one used for NMatrix, which also uses rake-compiler:
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'nmatrix/version'
Gem::Specification.new do |gem|
gem.name = "nmatrix"
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
# vvv THIS LINE vvv
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
# ^^^ THIS LINE ^^^
gem.extensions = ['ext/nmatrix/extconf.rb']
gem.require_paths = ["lib"]
gem.required_ruby_version = '>= 1.9.2'
gem.add_development_dependency 'rake', '~>0.9'
gem.add_development_dependency 'bundler'
gem.add_development_dependency 'rake-compiler', '~>0.8.1'
end
tl;dr: You might try looking at your line for gem.executables and make sure you have the relevant files included.

Ruby in `gem_original_require': no such file to load -- CloudyScripts (LoadError)

On Ubuntu and Ruby 1.8.7, I installed CloudyScripts via:
gem install gem install CloudyScripts
When I try to execute this:
require 'rubygems'
require 'CloudyScripts'
I get the following error:
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- CloudyScripts (LoadError)
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /home/ubuntu/copyami.rb:3
$ gem list
*** LOCAL GEMS ***
amazon-ec2 (0.9.17)
CloudyScripts (1.9.40)
net-scp (1.0.4)
net-ssh (2.2.1)
xml-simple (1.1.0)
The gem is installed in /var/lib/gems/1.8/gems, the contents of which are
drwxr-xr-x 6 root root 4096 2011-08-31 17:39 amazon-ec2-0.9.17
drwxr-xr-x 3 root root 4096 2011-08-31 18:39 CloudyScripts-1.9.40
drwxr-xr-x 4 root root 4096 2011-08-31 17:39 net-scp-1.0.4
drwxr-xr-x 5 root root 4096 2011-08-31 17:39 net-ssh-2.2.1
drwxr-xr-x 3 root root 4096 2011-08-31 17:39 xml-simple-1.1.0
And $LOAD_PATH is
/usr/local/lib/site_ruby/1.8
/usr/local/lib/site_ruby/1.8/x86_64-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/vendor_ruby/1.8
/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux
/usr/lib/ruby/vendor_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/x86_64-linux
.
Why am I getting the load error?
You should try
gem "CloudyScripts"
require "cloudyscripts"
Only the gem name is camelcased, but not the ruby files in it.
I had a similar problem when I was trying to run the rng(release notes generator command). The error is shown below.
/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- thor (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from ./rng:6:in `'
After lot of searching around I found the above post helpful. I just had to run
C:\mydirectory>gem install thor
The rng command works perfectly now

gem which cannot find gem despite it being installed

I've built my first gem but I don't seem to be able to get it to install correctly. I can issue the command
sudo gem install ceilingfish-toto
Which produces the output
Successfully installed ceilingfish-toto-0.3.6
1 gem installed
But when I then type gem which ceilingfish-toto. I get the output
Can't find ruby library file or shared library ceilingfish-toto
Which is very strange because if I go and look in my gems folder I can see all the files installed there
# ls -l /opt/local/lib/ruby/gems/1.8/gems/ceilingfish-toto-0.3.6/
total 48
-rw-r--r-- 1 root admin 1053 14 Feb 17:16 LICENSE
-rw-r--r-- 1 root admin 6166 14 Feb 17:16 README.md
-rw-r--r-- 1 root admin 879 14 Feb 17:16 Rakefile
-rw-r--r-- 1 root admin 6 14 Feb 17:16 VERSION
-rw-r--r-- 1 root admin 2477 14 Feb 17:16 ceilingfish-toto.gemspec
drwxr-xr-x 7 root admin 238 14 Feb 17:16 test
Does anyone know what could cause this? I think it's complaining because there is a hyphen in the gem name. You can see the gemspec here http://github.com/ceilingfish/toto
It's not the hyphen.
gem which searches for library files in gems, not gems. Compare:
$ gem which haml
/home/dave/.gem/ruby/1.8/gems/haml-3.0.12/lib/haml.rb
$ ls haml-3.0.12/lib/h*
haml haml.rb haml.rbc
Peachy. Note the existance of lib/haml.rb.
$ gem which rails
ERROR: Can't find ruby library file or shared library rails
$ ls rails-2.3.8/lib/r*
rails_generator.rb railties_path.rb rubyprof_ext.rb ruby_version_check.rb
There is no lib/rails.rb. But try:
$ gem which railties_path # not a gem
/home/dave/.gem/ruby/1.8/gems/rails-2.3.8/lib/railties_path.rb
So gem which ceilingfish-toto throws an error even when ceilingfish-toto is installed because there is no lib/ceilingfish-toto.rb file (there's not even a lib folder).
gem which ceilingfish-toto looks through the gem require path for a file named ceilingfish-toto.rb. Since there isn't one, it returns nothing. What would work for you is gem which toto, but since lib/ is not included in your gem spec, the lib files are not installed, so it doesn't exist.
Rerunning rake gemspec might fix the problem.
As an aside, you can check whether a gem is installed by its name by using gem list ceilingfish-toto which should show you it is installed, regardless of the files it has(it will also list the versions installed).
According to the gem naming recommendations:
If you’re adding functionality to another gem, use a dash. This usually corresponds to a / in the require statement (and therefore your gem’s directory structure) and a :: in the name of your main class or module.
If this is the case, if your gem is named alpha-beta you need to add a slash (/) to the gem which command
gem which alpha/beta

Resources