rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 2k forks source link

Bundle Error Installing Opal on W7: Errno::EACCES: Permission denied @ rb_sysopen - C:/RubyProjects...Gemfile #3674

Closed javabash closed 9 years ago

javabash commented 9 years ago

Hey guys,

I'm getting this error and could not find a related report.

--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?

  I ran the command `C:/Ruby21/bin/bundle `

- What did you expect to happen? 

Install these gems:

source "https://rubygems.org"
source 'https://rails-assets.org' do
  gem 'rails-assets-jquery'
end
gem 'opal'
gem 'opal-jquery'
gem 'slim'
gem 'sass'

  I expected Bundler to...

- What happened instead?

  Instead, what actually happened was...I got the following error:
Error details

    Errno::EACCES: Permission denied @ rb_sysopen - C:/RubyProjects/opal-playground/Gemfile
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler.rb:341:in `initialize'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler.rb:341:in `open'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler.rb:341:in `read_file'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/dsl.rb:31:in `eval_gemfile'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/dsl.rb:10:in `evaluate'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/definition.rb:25:in `build'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler.rb:155:in `definition'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/cli/install.rb:78:in `run'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/cli.rb:155:in `install'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/cli.rb:10:in `start'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/bin/bundle:20:in `block in <top (required)>'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
      C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.9.9/bin/bundle:18:in `<top (required)>'
      C:/Ruby21/bin/bundle:23:in `load'
      C:/Ruby21/bin/bundle:23:in `<main>'

Environment

    Bundler   1.9.9
    Rubygems  2.2.3
    Ruby      2.1.6p336 (2015-04-13 revision 50298) [i386-mingw32]
    GEM_HOME  C:/Ruby21/lib/ruby/gems/2.1.0
    GEM_PATH  C:/Ruby21/lib/ruby/gems/2.1.0;C:/Users/Phil/.gem/ruby/2.1.0
    Git       2.1.4
--- TEMPLATE END ----------------------------------------------------------------
indirect commented 9 years ago

@philipgelinas1 this error message line:

Errno::EACCES: Permission denied @ rb_sysopen - C:/RubyProjects/opal-playground/Gemfile

indicates that Bundler does not have permission to open or read your Gemfile, located at C:/RubyProjects/opal-playground/Gemfile. Grant the needed permissions, and then try again.

@bundler/core this is a good example of a case where we need to improve error handling around permissions.

jitendravyas commented 9 years ago

What to do to solve this on OSX?

agis commented 9 years ago

@jitendravyas As mentioned in the previous comment, the solution is to grant the needed permissions to your user and try again.

alexgpark commented 8 years ago

How do you grant permissions

wilddylan commented 8 years ago

chmod 777

Chrisn27 commented 4 years ago

chmod 777 -R <directory path> or chmod 777 -R ./ if you do it in the directory you want to modify. Run with sudo if you have root privileges.