2014-09-27 11 views
11

गलती से मैंने अपनी परियोजना पर sudo bundle install चलाया और अब जब मैं इसे अपने आप के रूप में चलाता हूं bundle install मुझे अनुमति अस्वीकार कर दी गई है (नीचे)। मैंने यहां https://github.com/bundler/bundler/blob/master/ISSUES.md#other-problems के निर्देशों का प्रयास किया, मेरी परियोजना को एक नई निर्देशिका में क्लोन करने और वहां से बंडल चलाने का भी प्रयास किया, कोई उपयोग नहीं। कृपया सहायता कीजिए!'सूडो बंडल इंस्टॉल' से पुनर्प्राप्त नहीं हो सकता है

error: cannot open .git/FETCH_HEAD: Permission denied 

Retrying git fetch --force --quiet --tags "/home/akonsu/.bundler/cache/git/em-postgresql-adapter-361cdc05eba5661bb17040a7a6c2a093f9c2263b" due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/home/akonsu/.bundler/cache/git/em-postgresql-adapter-361cdc05eba5661bb17040a7a6c2a093f9c2263b"` in directory /usr/local/lib/ruby/gems/2.1.0/bundler/gems/em-postgresql-adapter-3dfcc60378e9 has failed. 
If this error persists you could try removing the cache directory '/home/akonsu/.bundler/cache/git/em-postgresql-adapter-361cdc05eba5661bb17040a7a6c2a093f9c2263b' 
error: cannot open .git/FETCH_HEAD: Permission denied 

Retrying git fetch --force --quiet --tags "/home/akonsu/.bundler/cache/git/em-postgresql-adapter-361cdc05eba5661bb17040a7a6c2a093f9c2263b" due to error (3/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/home/akonsu/.bundler/cache/git/em-postgresql-adapter-361cdc05eba5661bb17040a7a6c2a093f9c2263b"` in directory /usr/local/lib/ruby/gems/2.1.0/bundler/gems/em-postgresql-adapter-3dfcc60378e9 has failed. 
If this error persists you could try removing the cache directory '/home/akonsu/.bundler/cache/git/em-postgresql-adapter-361cdc05eba5661bb17040a7a6c2a093f9c2263b' 
error: cannot open .git/FETCH_HEAD: Permission denied 

Git error: command `git fetch --force --quiet 
--tags "/home/akonsu/.bundler/cache/git/em-postgresql-adapter-361cdc05eba5661bb17040a7a6c2a093f9c2263b"` in directory 
/usr/local/lib/ruby/gems/2.1.0/bundler/gems/em-postgresql-adapter-3dfcc60378e9 
has failed. 
If this error persists you could try removing the cache directory 
'/home/akonsu/.bundler/cache/git/em-postgresql-adapter-361cdc05eba5661bb17040a7a6c2a093f9c2263b' 
+0

'chown आर akonsu: akonsu/घर/akonsu/.bundler'? – Smar

+0

या कैश डीआईआर को हटाने की तरह त्रुटि ने कहा ...? – Smar

+0

ने कोशिश की कि ... मैं मालिक हूं। – akonsu

उत्तर

10

रेपो को एक नई निर्देशिका में क्लोन करने से मदद नहीं मिलेगी। आपने बंडल विशिष्ट निर्देशिका के बजाय मानक रत्न निर्देशिका में रत्न स्थापित किए हैं।

सबसे अच्छा विकल्प बंडल को एक नई निर्देशिका में स्थापित करना और सिस्टम पथ में स्थापित रत्नों को अनदेखा करना है।

bundle install --path /home/akonsu/.new_project_bundle आज़माएं। आपको हर बार यह विकल्प निर्दिष्ट करने की आवश्यकता नहीं है। यह याद किया जाता है।

http://bundler.io/v1.3/man/bundle-install.1.html

इसके अलावा, आप के रूप में टिप्पणी में उल्लेख किया बंडलर का कैश निर्देशिका की अनुमति सेट (या इसे हटा) की जरूरत है।

+0

धन्यवाद। अन्य विकल्प क्या हैं? – akonsu

+0

यदि आप मौजूदा स्थापित रत्नों का उपयोग करना चाहते हैं: सिस्टम मणि निर्देशिका पर सही अनुमतियां सेट करना, जिसका अर्थ है नियमित उपयोगकर्ता लिखने की अनुमति /usr/local/lib/ruby/gems/2.1.0 पर। लेकिन यह वास्तव में एक अच्छा विचार नहीं है। एक और आसान विकल्प GEM_HOME को आपके bashrc या bash_profile (या समकक्ष) में ~/.ruby_gems/जैसे कुछ सेट करना होगा। यह फिर से आपके वर्तमान स्थापना को अनदेखा करने का मतलब है। यदि आपके पास कोई भी है, तो यह अन्य रूबी ऐप्स को प्रभावित करेगा, क्योंकि उन्हें इस नए GEM_HOME में उनके रत्न नहीं मिलेंगे। आपको सभी ऐप्स के लिए बंडल इंस्टॉल करना होगा। – brahmana

22

आज मेरे मैक में आज भी यही समस्या थी। मैंने इसे ~/.bundle फ़ोल्डर को हटाकर हल किया।

उसके बाद मैं bundle install --path ~/.bundle चलाता हूं और सब कुछ ठीक काम कर रहा था।

2

पढ़ें बंडलर की वेबसाइट पर क्या दिया गया है और कोई बाहरी सहायता की आवश्यकता नहीं होगी।

रत्न आपके रत्न के लिए आपके डिफ़ॉल्ट सिस्टम स्थान पर स्थापित किए जाएंगे। यदि आपके सिस्टम रत्न रूट-स्वामित्व वाले स्थान (जैसे मैक ओएसएक्स में) में संग्रहीत हैं, तो बंडल आपके रूट पासवर्ड को वहां इंस्टॉल करने के लिए कहेंगे।

रत्न स्थापित करते समय, बंडलर विक्रेता/कैश और फिर आपके सिस्टम के रत्नों की जांच करेगा। यदि एक मणि कैश या स्थापित नहीं किया गया है, तो बंडलर इसे आपके जेमफाइल में घोषित स्रोतों से स्थापित करने का प्रयास करेगा।

--system विकल्प डिफ़ॉल्ट है। नीचे वर्णित --path विकल्प का उपयोग करने के बाद इसे वापस स्विच करने के लिए पास करें।

अपनी निर्भरता, यहां तक ​​कि रत्न जो आपके सिस्टम रत्नों में पहले से इंस्टॉल हैं, आपके सिस्टम के मणि भंडार के अलावा किसी अन्य स्थान पर स्थापित करें। इस मामले में, उन्हें विक्रेता/बंडल में स्थापित करें।

$ bundle install --path vendor/bundle 

आगे बंडल आदेश या कॉल Bundler.setup या Bundler.require को इस स्थान को याद रखेगा।

स्रोत: http://bundler.io/v1.9/bundle_install.html

संबंधित मुद्दे