fw@testbox:~$ whereis bundle
bundle: /usr/bin/bundle
fw@testbox:~$
fw@testbox:~$ file /usr/bin/bundle
/usr/bin/bundle: a /usr/bin/ruby script, ASCII text executable
fw@testbox:~$
fw@testbox:~$ ls -lah /usr/bin/bundle
-rwxr-xr-x 1 root root 595 Oct 19 20:00 /usr/bin/bundle
fw@testbox:~$
fw@testbox:~$ /usr/bin/bundle
Could not locate Gemfile or .bundle/ directory
fw@testbox:~$
fw@testbox:~$ sudo /usr/bin/bundle
Don’t run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this
machine.
Could not locate Gemfile
fw@testbox:~$
fw@testbox:~$ cat -n /usr/bin/bundle
1 #!/usr/bin/ruby
2
3 # Exit cleanly from an early interrupt
4 Signal.trap(“INT”) { exit 1 }
5
6 require ‘bundler’
7 # Check if an older version of bundler is installed
8 $LOAD_PATH.each do |path|
9 if path =~ %r’/bundler-0\.(\d+)’ && $1.to_i < 9
10 err = “Looks like you have a version of bundler that’s older than 0.9.\n”
11 err << “Please remove your old versions.\n”
12 err << “An easy way to do this is by running `gem cleanup bundler`.”
13 abort(err)
14 end
15 end
16
17 require ‘bundler/friendly_errors’
18 Bundler.with_friendly_errors do
19 require ‘bundler/cli’
20 Bundler::CLI.start(ARGV, :debug => true)
21 end
fw@testbox:~$
I had this error after ran gem update –system
http://stackoverflow.com/questions/10012181/bundle-install-returns-could-not-locate-gemfile
1 fw@testbox:/usr/bin$ bundle
2 — ERROR REPORT TEMPLATE ——————————————————-
3 – What did you do?
4
5 I ran the command `/usr/bin/bundle `
6
7 – What did you expect to happen?
8
9 I expected Bundler to…
10
11 – What happened instead?
12
13 Instead, what actually happened was…
14
15
16 Error details
17
18 Errno::EACCES: Permission denied @ dir_s_mkdir – /usr/bin/.bundle
19 /usr/lib/ruby/2.2.0/fileutils.rb:252:in `mkdir’
20 /usr/lib/ruby/2.2.0/fileutils.rb:252:in `fu_mkdir’
21 /usr/lib/ruby/2.2.0/fileutils.rb:226:in `block (2 levels) in mkdir_p’
22 /usr/lib/ruby/2.2.0/fileutils.rb:224:in `reverse_each’
23 /usr/lib/ruby/2.2.0/fileutils.rb:224:in `block in mkdir_p’
24 /usr/lib/ruby/2.2.0/fileutils.rb:210:in `each’
25 /usr/lib/ruby/2.2.0/fileutils.rb:210:in `mkdir_p’
26 /usr/lib/ruby/vendor_ruby/bundler/settings.rb:208:in `set_key’
27 /usr/lib/ruby/vendor_ruby/bundler/settings.rb:31:in `[]=’
28 /usr/lib/ruby/vendor_ruby/bundler/cli/install.rb:99:in `run’
29 /usr/lib/ruby/vendor_ruby/bundler/cli.rb:162:in `install’
30 /usr/lib/ruby/vendor_ruby/thor/command.rb:27:in `run’
31 /usr/lib/ruby/vendor_ruby/thor/invocation.rb:126:in `invoke_command’
32 /usr/lib/ruby/vendor_ruby/thor.rb:359:in `dispatch’
33 /usr/lib/ruby/vendor_ruby/thor/base.rb:440:in `start’
34 /usr/lib/ruby/vendor_ruby/bundler/cli.rb:10:in `start’
35 /usr/bin/bundle:20:in `block in <main>’
36 /usr/lib/ruby/vendor_ruby/bundler/friendly_errors.rb:7:in `with_friendly_errors’
37 /usr/bin/bundle:18:in `<main>’
38
39 Environment
40
41 Bundler 1.10.6
42 Rubygems 2.6.2
43 Ruby 2.2.4p230 (2015-12-16 revision 0) [x86_64-linux-gnu]
44 Git 2.7.0
45
46 Bundler settings
47
48 path
49 Set for the current user (/home/fw/.bundle/config): “vendor/cache”
50 disable_shared_gems
51 Set for your local app (/usr/bin/.bundle/config): “1”
52 Set for the current user (/home/fw/.bundle/config): “1”
53 — TEMPLATE END —————————————————————-
54
55 Unfortunately, an unexpected error occurred, and Bundler cannot continue.
56
57 First, try this link to see if there are any existing issue reports for this error:
58 https://github.com/bundler/bundler/search?q=Permission+denied+%40+dir_s_mkdir+-+%2Fusr%2Fbin%2F.bundle&type=Issues
59
60 If there aren’t any reports for this error yet, please create copy and paste the report template above into a new issue. Don’t forget to anonymize any private data! The new issue form is located at:
61 https://github.com/bundler/bundler/issues/new
62 fw@testbox:/usr/bin$
63 fw@testbox:/usr/bin$
64 fw@testbox:/usr/bin$
65 fw@testbox:/usr/bin$ sudo bundle
66 Don’t run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will
67 break this application for all non-root users on this machine.
68 Could not locate Gemfile or .bundle/ directory
69 fw@testbox:/usr/bin$
Ref: