-
Notifications
You must be signed in to change notification settings - Fork 70
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
chapter 3 : Error Api Routing #7
Comments
Did you restart the application?, also how is the sabisu configuration? |
How can I solve the problem I can confirm the other url as blow: I can't only http://api.marketplaceapi.dev:3000/sabisu_rails/explorer in chapter 3. |
Are you using a multithread server?, something like puma or unicorn? |
umm.. may be, I did't using multithreaded server on local. I use ver WEBrick 1.3.1 I checked the process in my local. I check two ruby process in my local. ruby 3807 y_kim 12u IPv6 0x70d9ffafb4192263 0t0 TCP localhost:hbci (LISTEN) |
There are two possible solutions: You can use puma + foreman + Procfile to run it on a single instance. Procfile
The other option is to run the api with Pow and the same rails app with let's say, |
I did it you said. But I can't. |
But are you using Foreman? |
I use foreman as blow my gem file like as blowsource 'https://rubygems.org' gem 'rails', '4.2.4' gem 'active_model_serializers', github: 'rails-api/active_model_serializers' gem 'devise' gem 'sabisu_rails', github: 'IcaliaLabs/sabisu-rails' gem 'sdoc', '~> 0.4.0', group: :doc group :development do group :test do gem 'puma' gem 'foreman' |
You have to access the foreman server, so:
How does the sabisu initializer look like? |
Thank you. I success to see the page. Really appreciate to you. |
Sweet! I'm closing the issue then |
I have the same issue, probably I do something wrong here. Procfile
Gemfile:gem 'sabisu_rails', github: "IcaliaLabs/sabisu-rails"
gem 'compass-rails'
gem 'furatto'
gem 'font-awesome-rails'
gem 'simple_form'
gem 'puma'
gem 'devise' # api gem 'active_model_serializers'
gem 'rails', '4.2.4' sabisu initializerSabisuRails.setup do |config|
config.base_api_uri = 'api.marketplaceapi.dev'
config.api_headers = { "Accept" => "application/vnd.marketplace.v1" }
config.resources = [:users]
config.default_resource = :users The app is started with: foreman start -p 3000And I still get the error if I go to:
Before the error is shown I see a popup window where I put user name and password. Any ideas of what could go wrong here? |
If you are using prax, you have to include the port on the SabisuRails.setup do |config|
config.base_api_uri = 'api.marketplaceapi.dev:3000'
.
.
. |
It is really weird, if you are using Foreman, try changing the base_uri to the one Foreman provides, and run the rails server on another console session, and try to access... |
@kurenn, Here is my procfile
I tried both ports 4000 and 3000 and on both of them I get the same error I spent the whole last saturday debugging usage of httparty and found that it uses port 80 whatever I do. When I define the port explicitly "http://api.marketplace.dev:3000" - I get the timeout error in httparty. I would like to stick to one option, whatever you would recommend, either prax or foreman. I just want it to work :) |
Are you using prax? |
I do, the application is linked to prax. On the screenshots above I used foreman. You can just put me on the right direction or the one you would started to investigate. |
If you stop using prax, you have to configure the config.base_uri = "localhost:4000/api" And then you can access the explorer through If you choose this option, you will have to change your routes a bit, in order to respond to an api namespace instead of a subdomain: Before: namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: '/' do
end After: namespace :api, defaults: { format: :json }, path: '/api' do
end |
Ok, finally it started to make sense for me.
Give me some time and I will tell you whether the issue is still valid. |
It has to be probably with the port used by it and httparty, I'll check out this last gem to see if I can send a pull request ;) |
And this is the best thing I have ever seen in my life Now I am happy to stop thinking about django as the bigger out of the box feature provider . If I can help you somehow with the fix, I am happy to give a try. |
@tamatsyk Sure, I'll let you know! I'm really happy you made it to work! Enjoy! |
Tried to make it work here and I had to give up :( |
start prax in the background |
when i'm trying to access sabisu_rails/explorer, i had this error
Connection refused - connect(2) for "api.marketplaceapi.dev" port 80
i had move the project market_place_api to marketplaceapi folder. But the error is keep coming.
The text was updated successfully, but these errors were encountered: