121
4

11 回答 11

266

You just need to change directories to your app, THEN run bundle install :)

于 2012-04-04T16:17:39.637 回答
22

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

BUNDLE_GEMFILE="MyProject/Gemfile.ios" bundle install
于 2014-10-20T11:32:52.740 回答
22

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
于 2016-08-31T17:38:26.677 回答
14

You must be in the same directory of Gemfile

于 2015-02-26T14:24:42.510 回答
9

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

于 2019-11-05T19:51:00.787 回答
8

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

于 2016-02-02T15:48:49.070 回答
1
  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.
于 2020-04-30T00:16:29.503 回答
1

In my case this worked:

  • cd /usr/bin
  • touch Gemfile
  • Now you can then run bundle install.
于 2021-05-23T15:12:49.940 回答
-1

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"

于 2016-08-30T09:37:23.537 回答
-1
sudo gem install rails

my problem solved, just this code.

于 2021-03-18T19:29:39.603 回答
-14

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

于 2016-02-02T15:40:20.603 回答