Can't find gem railties (= 0.a) with executable rails (Gem::GemNotFoundException)
try to run gem install bundler
then run bundle
if you still getting the error then run,
bundle install --path vendor/bundle
can't find gem rails - Gem::GemNotFoundException
If you use the command bundle install
to install your gems off of a GEMFILE
, it will install the gems into your default system location for gems, as outlined in the bundler docs here. After that, you can use bundlers bundle exec
command to execute a command in the context of the bundle, as outlined in the docs here. This will ensure that the version of the gem you installed using bundle install
is executed.
If you look at the homepage for bundler, which provides an overview of the docs, it states the following:
In some cases, running executables without bundle exec may work, if the executable happens to be installed in your system and does not pull in any gems that conflict with your bundle.
However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine.
I'm guessing that you run gem which rails
in your console, and then run bundle show rails
in your console, the default installed rails installation for your system differs from the one installed for your bundle.
You say that you are using rvm
for your ruby
and gem
management. I'm thinking you may not have properly configured it. Trying executing the rvm notes
command in your console to ensure that you have addressed all of the required/recommended steps for installation on your OS. You want to ensure that the executables for rvm
are the first things included in your path when you run echo $PATH
ideally. This will ensure that the gems installed for rvm
will be the ones executed when you try executing them without prefixing bundle exec
. If rvm notes
doesn't give you the hints necessary to accomplish that, then try carefully reviewing the docs for installation on the RVM website.
can't find gem error when trying to create a new rails 5.1.4 project
The error suggested that you don't have Rails 5.1.4 installed in your system. Try install it by gem install rails -v 5.1.4
and then rails _5.1.4_ new NewAPP
again.
Rails: Could not find railties
rvm implode
was the answer. Something probably went wrong before, now everything works after a rvm reinstall.
GemNotFoundException when using Ruby on Rails after installation
I deleted the folder with Ruby 2.3.3 in it, which I'd gotten from RailsInstaller, and reinstalled Ruby 2.6.6 with RubyInstaller. Then I did "gem install rails" again, and it worked.
Bundler: can't find gem bundler (= 0.a) with executable bundle (Gem::GemNotFoundException) during bundle install with gem
Bundler version 2 introduced a new feature to automatically use the version of Bundler specified in the Gemfile.lock
of your project. Thus, if you have an existing Gemfile.lock
with a line like this at the bottom
BUNDLED WITH
1.17.3
Bundler will try to run with a Bundler version < 2.0. Since you just have Bundler 2.0.1 (and Rubygems >= 2.7.0) installed, this fails with this rather unhelpful error message.
To fix this, you could
- remove the lines from your
Gemfile.lock
and to use bundler 2.x everywhere from now on, or - install a bundler 1.x version with
gem install bundler -v '< 2.0'
to use the appropriate version as specified by yourGemfile.lock
.
More information about this can be found on the Bundler blog.
Related Topics
Typeerror: Object Doesn't Support This Property or Method
Error Building Ruby in Sublime Text Editor
Cron Is Running in Home Directory Instead of File Directory
How to Click a Link in a Table Based on the Text in a Row
How to Set a Proxy in Rubys Net/Http
How to Convert a Ruby Bigdecimal to a 2-Decimal Place String
How to Raise an Exception in an Rspec Test
How to Make a Ruby Enumerator That Does Lazy Iteration Through Two Other Enumerators
Ruby: Overriding the Puts Method
Building Gem, Executable Not Found
Fileutils.Mv Throwing Invalid Char \302 and \255 Exception
Ruby Ternary Operator Structure
How to Call a Method That Is a Hash Value
Linking Two Models in a Multi-Model Form