Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net::ReadTimeout in SabisuRails::ExplorerController#index #46

Open
pdkproitf opened this issue Dec 7, 2016 · 4 comments
Open

Net::ReadTimeout in SabisuRails::ExplorerController#index #46

pdkproitf opened this issue Dec 7, 2016 · 4 comments

Comments

@pdkproitf
Copy link

pdkproitf commented Dec 7, 2016

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

@kurenn
Copy link
Owner

kurenn commented Dec 24, 2016

Hi @pdkproitf ,

What is the version of Rails you are using?

@pdkproitf
Copy link
Author

I using rails 5.

@kurenn
Copy link
Owner

kurenn commented Jan 19, 2017

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?

@fabOnReact
Copy link

fabOnReact commented Nov 6, 2017

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants