2016-08-28 3 views
0

Я пытаюсь запустить приложение Ruby on Rails на локальном сервере, используя команду терминала Rails S, но затем меня попросят установить все драгоценные камни на этот ноутбук. OsxBundle Install не работает - разрешение Git отклонено

Это терминал вывод:

Johns-MacBook-Pro-2:spu-test JohnSmith$ rails s 
Could not find coffee-rails-4.0.1 in any of the sources 
Run `bundle install` to install missing gems. 
Johns-MacBook-Pro-2:spu-test JohnSmith$ bundle install 
Fetching gem metadata from https://rubygems.org/ 
Fetching version metadata from https://rubygems.org/ 
Fetching dependency metadata from https://rubygems.org/ 
error: cannot open .git/FETCH_HEAD: Permission denied 

Retrying git fetch --force --quiet --tags "/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca" due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca"` in directory /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-3d7605f82706 has failed. 
If this error persists you could try removing the cache directory '/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca' 
error: cannot open .git/FETCH_HEAD: Permission denied 

Retrying git fetch --force --quiet --tags "/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca" due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca"` in directory /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-3d7605f82706 has failed. 
If this error persists you could try removing the cache directory '/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca' 
error: cannot open .git/FETCH_HEAD: Permission denied 

Retrying git fetch --force --quiet --tags "/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca" due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca"` in directory /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-3d7605f82706 has failed. 
If this error persists you could try removing the cache directory '/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca' 
error: cannot open .git/FETCH_HEAD: Permission denied 

Git error: command `git fetch --force --quiet --tags 
"/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca"` 
in directory /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-3d7605f82706 has 
failed. 
If this error persists you could try removing the cache directory 
'/Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca' 
Johns-MacBook-Pro-2:spu-test JohnSmith$ 

ERROR с помощью Суд расслоения установки после удаления каталога кэша:

Johns-MacBook-Pro-2:spu-test JohnSmith$ sudo bundle install 
Password: 
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. 
Fetching gem metadata from https://rubygems.org/ 
Fetching version metadata from https://rubygems.org/ 
Fetching dependency metadata from https://rubygems.org/ 
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. 
Using rake 10.3.2 
Using Ascii85 1.0.2 
Using i18n 0.6.9 
Using minitest 4.7.5 
Using multi_json 1.10.1 
Using thread_safe 0.3.4 
Using tzinfo 0.3.39 
Using builder 3.1.4 
Using erubis 2.7.0 
Using rack 1.5.2 
Using mime-types 1.25.1 
Using polyglot 0.3.5 
Using sass 3.2.19 
Using thor 0.19.1 
Using coffee-script-source 1.7.0 
Using execjs 2.1.0 
Using activerecord-deprecated_finders 1.0.3 
Using arel 4.0.2 
Using bundler 1.12.5 
Using hike 1.2.3 
Using tilt 1.4.1 
Using addressable 2.3.6 
Using afm 0.2.1 
Using aws_cf_signer 0.1.3 
Using bcrypt 3.1.7 
Using cancan 2.0.0.alpha from git://github.com/ryanb/cancan.git (at [email protected]) 
Using json 1.8.1 
Using orm_adapter 0.5.0 
Using excon 0.42.0 
Using geocoder 1.2.4 
Using gmaps4rails 2.1.2 
Using hashery 2.1.1 
Using pdf-core 0.1.6 
Using ruby-rc4 0.1.5 
Using ttfunk 1.1.1 
Installing pg 0.17.1 with native extensions 

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /usr/local/bin/pg_config 
checking for libpq-fe.h... yes 
checking for libpq/libpq-fs.h... yes 
checking for pg_config_manual.h... yes 
checking for PQconnectdb() in -lpq... no 
checking for PQconnectdb() in -llibpq... no 
checking for PQconnectdb() in -lms/libpq... no 
Can't find the PostgreSQL client library (libpq) 
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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}/ 
    --with-pqlib 
    --without-pqlib 
    --with-libpqlib 
    --without-libpqlib 
    --with-ms/libpqlib 
    --without-ms/libpqlib 


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/pg-0.17.1 for inspection. 
Results logged to /Library/Ruby/Gems/2.0.0/gems/pg-0.17.1/ext/gem_make.out 
Using rails3_serve_static_assets 0.0.1 from git://github.com/heroku/rails3_serve_static_assets.git (at [email protected]) 
Using rails_log_stdout 0.0.1 from git://github.com/heroku/rails_log_stdout.git (at [email protected]) 
Using underscore-rails 1.6.0 
Using will_paginate 3.0.5 
Using activesupport 4.0.5 
Using rack-test 0.6.2 
Using warden 1.2.3 
Using rest-client 1.6.7 
Using treetop 1.4.15 
Using bourbon 3.2.3 
Using coffee-script 2.2.0 
Using sprockets 2.11.0 
Using rdoc 4.1.1 
Using uglifier 2.5.0 
Using mandrill-api 1.0.53 
Using pdf-reader 1.3.3 
Using prawn 0.15.0 
An error occurred while installing pg (0.17.1), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling. 
+0

Вы можете запустить его в sudo или изменить разрешения для папок и файлов. –

+0

@AndrejLudinovskov Я пробовал использовать sudo, это не имеет никакого значения, как мне изменить разрешения для папок и файлов? – RubyMax

+0

Вы пытались удалить /Users/JohnSmith/.bundle/cache/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca, как было предложено, и запустить снова с помощью sudo? –

ответ

0

я получил тот же вопрос, и я установил его, как это.

  1. Резервное копирование текущих .bundle и поставщика директории
  2. Затем удалите и каталоги
  3. Run bundle clean --force
  4. Наконец, запустите bundle install --path vendor/cache

bundle install --path vendor/cache

Ваша проблема будет решена , :)