Failed rebuild (Could not find 'rest-client)

AI-generated summary

The user huulbaek encountered a Could not find 'rest-client' error while upgrading Discourse from 1.8 to 1.9 using ./launcher rebuild app. The issue stemmed from the df-core plugin, which depends on the rest-client gem, now removed from Discourse core. mpalmer explained that plugins must explicitly declare the gem. huulbaek resolved the issue by commenting out the plugin activation line in the plugin file, as they weren’t using it. mpalmer suggested either removing the plugin activation or adding gem 'rest-client' to the plugin’s gemspec. huulbaek confirmed the fix worked after disabling the plugin.

I tried upgrading from 1.8 to 1.9 but ./launcher rebuild app fails. Here’s some lines I think important:

I, [2017-08-02T06:27:53.765784 #15]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
Gem::LoadError: Could not find 'rest-client' (>= 0) among 173 total gem(s)
Checked in 'GEM_PATH=/var/www/discourse/vendor/bundle/ruby/2.3.0', execute `gem env` for more information
/var/www/discourse/lib/plugin_gem.rb:18:in `load'
/var/www/discourse/lib/plugin/instance.rb:379:in `gem'
/var/www/discourse/plugins/df-core/plugin.rb:27:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:326:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:326:in `activate!'
/var/www/discourse/lib/discourse.rb:125:in `block in activate_plugins!'
/var/www/discourse/lib/discourse.rb:122:in `each'
/var/www/discourse/lib/discourse.rb:122:in `activate_plugins!'
/var/www/discourse/config/application.rb:179:in `<class:Application>'
/var/www/discourse/config/application.rb:26:in `<module:Discourse>'
/var/www/discourse/config/application.rb:25:in `<top (required)>'
/var/www/discourse/Rakefile:5:in `require'
/var/www/discourse/Rakefile:5:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'

Help very much appreciated.

You’re running a plugin (df-core, by the look of it) that needs to be updated to be 1.9 compatible. The rest-client gem got removed from core, so now plugins have to specify that themselves if they want it.

You are right. I actually don’t use it. I have cloned it in my own repo and commented most of it out to get around this error.

Any advice on getting around any of these errors? How would I go about requiring the gem if that’s the easiest fix to get up and running?

Well, you could comment out the line that’s activating the plugin (line 27, by the look of it), or you could add gem 'rest-client' up the top.

Again, thank you. I killed line 27 and some lines below that and everything is back up :slight_smile: