sabisu-rails icon indicating copy to clipboard operation
sabisu-rails copied to clipboard

Net::ReadTimeout in SabisuRails::ExplorerController#index

Open pdkproitf opened this issue 8 years ago • 4 comments

Hey everybody. I got a error when i try to make api on raill follow this book http://apionrails.icalialabs.com/book/ Please help me. And I found the same roblem at issues #30 but It closed with no solution. So what going on with this errors. screenshot from 2016-12-07 12-11-23

pdkproitf avatar Dec 07 '16 05:12 pdkproitf

Hi @pdkproitf ,

What is the version of Rails you are using?

kurenn avatar Dec 24 '16 00:12 kurenn

I using rails 5.

pdkproitf avatar Jan 13 '17 02:01 pdkproitf

I have not tested yet with Rails 5, I can give it a spin on the weekend, but for what I can see it has to do with a dependency from the gem, how does your initializer look like?

kurenn avatar Jan 19 '17 16:01 kurenn

@kurenn

I have the same problem with rails 4.0.2

this is my routes.rb

Rails.application.routes.draw do
  mount SabisuRails::Engine => "/sabisu_rails"
	namespace :api, defaults: { format: :json } do
		namespace :v1 do
			devise_for :users
			resources :users, :only => [:show, :create, :update, :destroy]
		end
	end
end

this is my sabisu_rails.rb

# Use this module to configure the sabisu available options

SabisuRails.setup do |config|

  # Base uri for posting the 
  config.base_api_uri = 'localhost:3000' 

  # Ignored attributes for building the forms
  # config.ignored_attributes = %w{ created_at updated_at id }
  
  # HTTP methods
  # config.http_methods = %w{ GET POST PUT DELETE PATCH }
  
  # Headers to include on each request
  #
  # You can configure the api headers fairly easy by just adding the correct headers
  # config.api_headers = { "Accept" => "application/json,application/vnd.application.v1" }
  #
  # config.api_headers = {}

  # Layout configuration
  # config.layout = "sabisu"

  # Resources on the api
  # config.resources = [:products, :users...]
  config.resources = [:users]

  # Default resource
  config.default_resource = 'users'

  # Application name
  # mattr_accessor :app_name
  # @@app_name = Rails.application.class.parent_name

  # Authentication
  # mattr_accessor :authentication_username
  # @@authentication_username = "admin"

  # mattr_accessor :authentication_password
  # @@authentication_password = "sekret"

end

also I dont know how I should configure my base_api_uri as my routes are just localhost:3000/api/vi/users

if I don't set the config.base_api_uri I will have the following error

Errno::ECONNREFUSED in SabisuRails::ExplorerController#index
Failed to open TCP connection to :80 (Connection refused - connect(2) for nil port 80)

also I noted that I did not install pow because I am just not using this http://market_place_api.dev/ in localdevelopment, also I use linux so I just skipped that part...

Thanks a lot for the guide

fabOnReact avatar Nov 06 '17 14:11 fabOnReact