أواجه مشكلة أثناء تثبيت بعض الـ gems في الـ plugin

@sam

I’m unable to install some gems in the plugin, for e.g. google-protobuf. This gem is dependency for google-cloud-vision gem.

Here’s a plugin trying to install it. GitHub - fzngagan/gem-issue

Logs
gem install google-protobuf -v 3.13.0 -i /Users/faiz/discenv/discourse/plugins/gem-issue/gems/2.6.3 --no-document --ignore-dependencies --no-user-install
Successfully installed google-protobuf-3.13.0-universal-darwin
1 gem installed
You are specifying the gem google-protobuf in /Users/faiz/discenv/discourse/plugins/gem-issue/plugin.rb, however it does not exist!
Looked for: /Users/faiz/discenv/discourse/plugins/gem-issue/gems/2.6.3/specifications/google-protobuf-3.13.0.gemspec

The reason for this is that the .gemspec file’s name doesn’t match the spec_file’s name assumed in the code here.

IMO, this would happen probably only when using platform-specific gems as the platform name gets added to the gem name if its platform dependent. This is described here. Specification Reference - RubyGems Guides

3 إعجابات

It’s unclear why you mentioned me on this topic? I don’t know much about our custom gem resolution, sorry.

إعجاب واحد (1)

I checked the blame and you have the most commits to the file I guess? Happy to be pointed in the right direction here :slight_smile:

I think @sam might be able to help. He wrote the gem importing for plugins.

3 إعجابات

Sure, thanks for the lead.

@سام هل سنحت لك الفرصة لإلقاء نظرة؟

@sam هل يمكنك مساعدة @fzngagan في هذا؟ أنا أمول هذا الإضافة:

وسيتاح للجميع. من الضروري الحفاظ على المنتدى خاليًا من الصور التي قد تضر، وسيساعد بالتأكيد في تجنب تلقي إشعارات من Google Adsense بسبب المحتوى غير المسموح به.

إعجاب واحد (1)

أظن أن هناك خطأ برمجي هنا، ربما يمكنك تقديم طلب سحب (PR) لمحاولة إصلاح هذا الغرابة؟

إعجابَين (2)

إليك طلب سحب (PR) بسيط جدًا لحل هذه المشكلة.

حاولت إيجاد طريقة أنيقة للتعامل مع الأمر بحيث لا يضطر المطورون للقلق بشأن مسألة المنصة، لكنني لم أجد أيًا منها. يسعدني تحسين هذا الحل إذا عثرت على حل أفضل.

أيضًا، نصيحة للمطورين: يمكنك ببساطة إضافة المكتبة (gem) إلى ملف gemfile الخاص بـ discourse أثناء التطوير دون أن تصاب بالجنون. اقلق بشأن كل هذا فقط عند النشر.

5 إعجابات

شكرًا لك على الدمج @sam.

3 إعجابات