Gem Which Cannot Find Gem Despite It Being Installed

Bundler can't find a gem even though gem install works

I had a look at the Gemfile of some github projects using the same gem.

Try to add the engine and engine_version after the ruby version as follows:

# Gemfile

ruby '2.3.1', engine: 'jruby', engine_version: '9.1.8.0'
source 'https://rubygems.org'

gem 'jrubyfx', '~> 1.2'

According to bundler documentation:

Both :engine and :engine_version are optional. When these options are
omitted, this means the app is compatible with a particular Ruby ABI
but the engine is irrelevant. When :engine is used, :engine_version
must also be specified. Using the platform command with the --ruby
flag, you can see what ruby directive is specified in the Gemfile.

gem which cannot find gem despite it being installed

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).

Bundler can't find a gem that I can install using gem install

it seems like you are missing a , between the gem name and the version in the gemspec:

spec.add_runtime_dependency("rwanda", "~> 0.6.0")

bundle exec' complains about gem not being installed, even after 'bundle install'

After deleting the env directory and reinstalling, I noticed it created subdirectories for two Ruby versions - 2.1.0 and 2.2.0. The latter was my current version of Ruby, but the directory was empty (all the gems were installed into the env/ruby/2.1.0/gems directory). This, combined with Oliver's answer about rbenv, got me thinking about mismatched versions.

I reinstalled bundler with a simple gem install bundler, reran bundle install, and all is good.

It seems in general the answer is to sort out issues with bundler installing for a different version of Ruby than you're actually using. It seems strange to me it would use one thing for bundle install and another for bundle exec, but *shrug* whatever.



Related Topics



Leave a reply



Submit