[ruby-on-rails] bundle install returns "Could not locate Gemfile"

I'm new to Rails and am currently working through a guide. The guide states:

Use a text editor to update the Gemfile needed by Bundler with the contents of Listing 2.1.

source 'https://rubygems.org'

gem 'rails', '3.2.3'

group :development do
  gem 'sqlite3', '1.3.5'
end


# Gems used only for assets and not required
# in production environments by default.

group :assets do
  gem 'sass-rails',   '3.2.4'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.0'

group :production do
  gem 'pg', '0.12.2'
end

We then install and include the gems using the bundle install command:

    $ bundle install --without production 

If Bundler complains about no such file to load -- readline (LoadError) try adding gem ’rb-readline’ to your Gemfile.)

I followed the steps even adding on gem 'rb-readline' to the Gemfile, but apparently the file can't be found and when I go to my text editor I do see the Gemfile itself. I noticed that they made me put gem 'rails', 3.2.3 and my version of Rails is 3.2.1 so I tried changing it to 3.2.1 but that didn't work either.

Any thoughts or advice would be much appreciated.

This question is related to ruby-on-rails installation bundle gemfile

The answer is


I had this problem on Ubuntu 18.04. I updated the gem

sudo gem install rails
sudo gem install jekyll
sudo gem install jekyll bundler
cd ~/desiredFolder
jekyll new <foldername>
cd <foldername> OR 
bundle init
bundle install
bundle add jekyll
bundle exec jekyll serve

All worked and goto your browser just go to http://127.0.0.1:4000/ and it really should be running


You may also indicate the path to the gemfile in the same command e.g.

BUNDLE_GEMFILE="MyProject/Gemfile.ios" bundle install

  1. Make sure that the file name is Capitalized Gemfile instead of gemfile.
  2. Make sure you're in the same directory as the Gemfile.

Search for the Gemfile file in your project, go to that directory and then run "bundle install". prior to running this command make sure you have installed the gem "sudo gem install bundler"


You must be in the same directory of Gemfile


Think more about what you are installing and navigate Gemfile folder, then try using sudo bundle install


When I had similar problem gem update --system helped me. Run this before bundle install


I had this problem as well on an OSX machine. I discovered that rails was not installed... which surprised me as I thought OSX always came with Rails. To install rails

  • sudo gem install rails
  • to install jekyll I also needed sudo
  • sudo gem install jekyll bundler
  • cd ~/Sites
  • jekyll new <foldername>
  • cd <foldername> OR cd !$ (that is magic ;)
  • bundle install
  • bundle exec jekyll serve
  • Then in your browser just go to http://127.0.0.1:4000/ and it really should be running

Examples related to ruby-on-rails

Embed ruby within URL : Middleman Blog Titlecase all entries into a form_for text field Where do I put a single filter that filters methods in two controllers in Rails Empty brackets '[]' appearing when using .where How to integrate Dart into a Rails app Rails 2.3.4 Persisting Model on Validation Failure How to fix "Your Ruby version is 2.3.0, but your Gemfile specified 2.2.5" while server starting Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? Rails: Can't verify CSRF token authenticity when making a POST request Uncaught ReferenceError: React is not defined

Examples related to installation

You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) Conda version pip install -r requirements.txt --target ./lib How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" PackagesNotFoundError: The following packages are not available from current channels: Tensorflow import error: No module named 'tensorflow' Downgrade npm to an older version Create Setup/MSI installer in Visual Studio 2017 how to install tensorflow on anaconda python 3.6 Application Installation Failed in Android Studio How to install pip for Python 3.6 on Ubuntu 16.10?

Examples related to bundle

find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException) Where can I download Eclipse Android bundle? How to pass ArrayList<CustomeObject> from one activity to another? Simple example for Intent and Bundle ASP.NET Bundles how to disable minification MVC4 StyleBundle not resolving images What's onCreate(Bundle savedInstanceState) bundle install returns "Could not locate Gemfile" How to pass integer from one Activity to another? What is a "bundle" in an Android application

Examples related to gemfile

bundle install returns "Could not locate Gemfile" Should Gemfile.lock be included in .gitignore?