0
Wenn ich eine Suche mit Yourub gem Konfiguration für eine Suche Video youtube Leistung, die Server-Konsole mir gibt die folgende Fehlermeldung:Nameerror (nicht initialisierte Konstante) mit Yourub Gem
Completed 500 Internal Server Error in 7ms
NameError (uninitialized constant ExploreController::Yourub):
app/controllers/explore_controller.rb:18:in `search'
- Added
config/yourub.yml
wie gezeigt auf die Perle Website https://github.com/edap/yourub
Auf der explore_controller Datei wir diese finden können:
class ExploreController < ApplicationController
def index
...
end
def search
if params[:queryType] == "users"
...
elsif params[:queryType] == "tracks"
client = Yourub::Client.new
client.search(query: params[:queryField]) do |v|
puts v
end
return redirect_to('/explore')
else
return redirect_to('/explore')
end
end
end
hinzugefügt Auch meine yourub.yml Datei hier:
yourub_defaults: &yourub_defaults
developer_key: 'apiKey'
youtube_api_service_name: 'youtube'
youtube_api_version: 'v3'
application_name: "apiAplicationName"
application_version: "0.1"
log_level: WARN
development:
<<: *yourub_defaults
production:
<<: *yourub_defaults
test:
<<: *yourub_defaults
Könnte albern sein. Hast du den Server nach der Installation des Edelsteins neu gestartet? –
:) Vielen Dank Arun Kumar, genau das, was Sie gesagt haben, jaja, fügen Sie Ass Antwort –