簡體   English   中英

Errno :: EACCES:運行bundle時權限被拒絕,它命中json 1.8.1,pg 0.17

[英]Errno::EACCES: Permission denied when running bundle and it hits json 1.8.1, pg 0.17

我剛買了一台新筆記本電腦,並使用Migration Assistant完全轉移了所有內容。 看起來一切正常並處於適當的位置,所以我不知道這是不是問題。 我仍然是調試這樣的環境錯誤的新手。

我一直在Windows上開發一個rails項目,這台筆記本電腦是Mac OS X 10.8。 我之前已經克隆了一個GitHub項目,它運行良好。 這是github回購供參考。 當我運行bundle時,這個項目會出錯

錯誤

Using rake (10.1.0) 
Using i18n (0.6.1) 
Using multi_json (1.8.2) 
Using activesupport (3.2.13) 
Using builder (3.0.4) 
Using activemodel (3.2.13) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.2.2) 
Using actionpack (3.2.13) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (3.2.13) 
Using arel (3.0.2) 
Using tzinfo (0.3.38) 
Using activerecord (3.2.13) 
Using activeresource (3.2.13) 
Using bundler (1.3.5) 
Using rack-ssl (1.3.3) 
TheInstalling json (1.8.1) 
Errno::EACCES: Permission denied - /Users/user/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/.gitignore
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

Ruby Gem Env

Users-MacBook:soundtrackshare user$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.6
  - RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin12.3.0]
  - INSTALLATION DIRECTORY: /Users/user/.rvm/gems/ruby-2.0.0-p247
  - RUBY EXECUTABLE: /Users/user/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/user/.rvm/gems/ruby-2.0.0-p247/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-12
  - GEM PATHS:
     - /Users/user/.rvm/gems/ruby-2.0.0-p247
     - /Users/user/.rvm/gems/ruby-2.0.0-p247@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/

我自己的路

Users-MacBook:soundtrackshare user$ echo $PATH
/Users/user/.rvm/gems/ruby-2.0.0-p247/bin:/Users/user/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/user/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/user/.rvm/bin:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

嘗試將此添加到我的gemfile中

gem 'json', '1.8.0'

現在我在捆綁更新json之后得到這個新錯誤...我的最后一個項目也只在生產中做了Postgres,但是當我捆綁那個時我沒有看到pg gem。

You have requested:

json = 1.8.0

The bundle currently has json locked at 1.8.1.
Try running `bundle update json`
Run `bundle install` to install missing gems.
Users-MacBook:soundtrackshare user$ bundle update json
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0) 
Using i18n (0.6.1) 
Using multi_json (1.8.2) 
Using activesupport (3.2.13) 
Using builder (3.0.4) 
Using activemodel (3.2.13) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.2.2) 
Using actionpack (3.2.13) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (3.2.13) 
Using arel (3.0.2) 
Using tzinfo (0.3.38) 
Using activerecord (3.2.13) 
Using activeresource (3.2.13) 
Using bundler (1.3.5) 
Using rack-ssl (1.3.3) 
Using json (1.8.0) 
Using rdoc (3.12.2) 
Using thor (0.18.1) 
Using railties (3.2.13) 
Using rails (3.2.13) 
Using acts-as-taggable-on (2.4.1) 
Using atomic (1.1.14) 
Using bcrypt-ruby (3.1.2) 
Using sass (3.2.12) 
Using bootstrap-sass (2.3.2.2) 
Using cancan (1.6.10) 
Using coffee-script-source (1.6.3) 
Using execjs (2.0.2) 
Using coffee-script (2.2.0) 
Using coffee-rails (3.2.2) 
Using orm_adapter (0.4.0) 
Using thread_safe (0.1.3) 
Using warden (1.2.3) 
Using devise (3.1.1) 
Using faker (1.2.0) 
Using jquery-rails (3.0.4) 
Installing pg (0.17.0) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/user/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb 
checking for pg_config... yes
Using config values from /usr/bin/pg_config
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/user/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
    --with-pg
    --without-pg
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/
/Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
    from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:534:in `try_link'
    from extconf.rb:39:in `<main>'


Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.0 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.0/ext/gem_make.out

An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.

有線索嗎?

您可能需要安裝Xcode控制台工具,至少是我遇到的問題。

你可以通過運行:

xcode-select --install

有關更多信息,請參閱此鏈接

在小牛隊上安裝Rails

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM