Not exactly, but I still think it is dependency issues and not specifying the gems correctly.
I think it has to be the full version number like 6.2.0
. I also donāt think you need to specify ābundlerā or ānetā.
Apparently when writing a plugin you have to go through dependency hell to get it all working and happy. Basically the workflow I go though is start with the main gem that I want. In this case it is the twitter gem. Make sure this one is always listed as the last gem in your plugin.rb file.
gem 'twitter', '6.2.0', { require: false }
Then I look at all the runtime dependencies for this gem and ONE AT A TIME list each dependency with each subdependency above the twitter gem. Run bundle exec rails s
between each dependency and check for (Gem::MissingSpecError)
to know which dependency to add next.
Apparently the addressable gem (2.5.2, instead of 2.3.8) is already required by a discourse gem, so it should be safe to ignore. (You can run gem dependency addressable --reverse-dependencies
to see which gems require it).
Your plugin.rb should look something like:
gem 'buftok', '0.2.0', { require: false }
gem 'equalizer', '0.0.11', { require: false }
gem 'domain_name', '0.5.20180417', { require: false }
gem 'http-cookie', '1.0.3', { require: false }
gem 'http-form_data', '2.0.0', { require: false }
gem 'http_parser.rb', '0.6.0', { require: false }
gem 'http', '3.3.0', { require: false }
gem 'memoizable', '0.4.2', { require: false }
gem 'naught', '1.1.0', { require: false }
gem 'simple_oauth', '0.3.1', { require: false }
gem 'twitter', '6.2.0', { require: false }
#gem 'addressable', '2.3.8', { require: false } # Already required in Discourse
#gem 'multipart-post', '2.0.0', { require: false } # Already required in Discourse
require 'twitter'
client = Twitter::REST::Client.new do |config|
config.consumer_key = "YOUR_CONSUMER_KEY"
config.consumer_secret = "YOUR_CONSUMER_SECRET"
config.access_token = "YOUR_ACCESS_TOKEN"
config.access_token_secret = "YOUR_ACCESS_SECRET"
end
bundle exec rails s
should now run successfully and you can now write your plugin and break things out into separate files if youād like, but the gem dependencies should stay in the plugin.rb file.