I'm certainly no Ruby developer but I have an application on my server using Ruby, Gems, and Bundler. I am trying to install another Ruby on under a different user account but on the same VPS. When I go to run
bundle install
I get the following error:
Could not locate Gemfile
I could remove the contents of the ./bundle directory so that all Gems are re-fetched to clear the error but will this have an impact on my other application using the same Gems and Bundler? I don't want to risk taking the other app down.
You do not have
Gemfile
in a directory where you run that command.Gemfile
is a file containing yourgem
settings for a current program.Is very simple. when it says 'Could not locate Gemfile' it means in the folder you are currently in or a directory you are in, there is No a file named GemFile. Therefore in your command prompt give an explicit or full path of the there folder where such file name "Gemfile" is e.g cd C:\Users\Administrator\Desktop\RubyProject\demo.
It will definitely be solved in a minute.
Make sure you are in the project directory before running
bundle install
. For example, after runningrails new myproject
, you will want tocd myproject
before runningbundle install
.I had the same problem and got it solved by using a different directory.
I solved similar problem just by backing out of the project directory, then cd back into the project directory and bundle install.
Here is something you could try.
Add this to any config files you use to run your app.
Rails and other Rack based apps use this scheme. It happens sometimes that you are trying to run things which are some directories deeper than your root where your Gemfile normally is located. Of course you solved this problem for now but occasionally we all get into trouble with this finding the Gemfile. I sometimes like when you can have all you gems in the .bundle directory also. It never hurts to keep this site address under your pillow. http://bundler.io/