Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

400
Views
Recursos JSONAPI: NameError no pudo encontrar el recurso

Estoy usando JSONAPI-Resources un proyecto API. Cuando intento ponerle un espacio de nombres, aparece un error en el que el servidor no se inicia. Profundizando más cuando ejecuto bin/rails zeitwerk:check obtengo el siguiente error:

 NameError: JSONAPI: Could not find resource 'api/v1/connectors'. (Class Api::V1::ConnectorResource not found) /Users/David/Code/Ruby/my_project/config/routes.rb:7:in `block (3 levels) in <main>' /Users/David/Code/Ruby/my_project/config/routes.rb:6:in `block (2 levels) in <main>' /Users/David/Code/Ruby/my_project/config/routes.rb:5:in `block in <main>' /Users/David/Code/Ruby/my_project/config/routes.rb:3:in `<main>' /Users/David/Code/Ruby/my_project/config/environment.rb:5:in `<main>' /Users/David/Code/Ruby/my_project/bin/rails:5:in `<top (required)>' /Users/David/Code/Ruby/my_project/bin/spring:10:in `block in <top (required)>' /Users/David/Code/Ruby/my_project/bin/spring:7:in `<top (required)>' Tasks: TOP => zeitwerk:check => environment (See full trace by running task with --trace)

Simplemente al intentar agregar un recurso con espacio de nombres según la guía. Si elimino el espacio de nombres, funciona de maravilla.

conectores_controlador.rb

 module Api module V1 class ConnectorsController < ApplicationController end end end

conector_recurso.rb

 module Api module V1 class ConnectorResource < JSONAPI::Resource attributes :name, :description, :save_path, :created_at, :updated_at end end end

rutas.rb

 Rails.application.routes.draw do # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html namespace :api do namespace :v1 do jsonapi_resources :connectors, only: %i[index show] end end end
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Creo que está extraviando los recursos. La ruta real de los recursos debería estar debajo

resouces/api/V1/some_recource.rb

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!