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
Is There a Gem That Normalizes and Format Us Phone Numbers in Ruby
Configure Webrick to Use Automatically Generated Self-Signed Ssl/Https Certificate
Activerecords Select(:Id).Collect VS. Pluck(:Id) Methods: Why Is Pure Ar "Pluck" Slower
How to I Add a Hyperlink to a Cell in Axlsx
Need to Use Add_Index on Migration for Belongs_To/Has_Many Relationship? (Rails 3.2, Active Record)
Check If Array of Integers Increments in Ruby
Is Getting Converted as "\U0092" by Nokogiri in Ruby on Rails
Converting String "2½" (Two and a Half) into 2.5
Paperclip File Not Found Error
How to Delete a Range of Values from an Array
How to Make Xcode Use the Correct Version of Ruby When Running a Script
Split Seeds.Rb into Multiple Sections
Configuration in Allure to Cucumber in Ruby
Is This the Best Way to Grab Common Elements from a Hash of Arrays
Sidekiq Worker Not Getting Triggered
Why Does a Simple Thin Server Stop Responding at 16500 Requests When Benchmarking
Setting Mime Type for .Ogv Files in Rails Development Environment
Disable Rdoc and Ri Generation by Default for Rubygems 1.8.X