Giter Site home page Giter Site logo

Comments (25)

kurenn avatar kurenn commented on June 27, 2024

Did you restart the application?, also how is the sabisu configuration?

from market_place_api.

 avatar commented on June 27, 2024

How can I solve the problem
I'm using pow,
OS : mac os Capitan
ruby : ruby 2.2.1p85
rails : 4.2.4
pow : 0.5.0

I can confirm the other url as blow:
http://api.marketplaceapi.dev:3000/users/1

I can't only http://api.marketplaceapi.dev:3000/sabisu_rails/explorer in chapter 3.
https://gyazo.com/fb549b2c53c9abbfbec092a954d6c02f

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

Are you using a multithread server?, something like puma or unicorn?

from market_place_api.

 avatar commented on June 27, 2024

umm.. may be, I did't using multithreaded server on local.
I think Just use webrick embedded.

I use ver WEBrick 1.3.1

I checked the process in my local.

I check two ruby process in my local.
is it able to be problem?

ruby 3807 y_kim 12u IPv6 0x70d9ffafb4192263 0t0 TCP localhost:hbci (LISTEN)
ruby 3807 y_kim 13u IPv4 0x70d9ffafbd4a9b03 0t0 TCP localhost:hbci (LISTEN)

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

There are two possible solutions:

You can use puma + foreman + Procfile to run it on a single instance.

Procfile

web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}

The other option is to run the api with Pow and the same rails app with let's say, rails s and go to the sabisu url

from market_place_api.

 avatar commented on June 27, 2024

I did it you said. But I can't.
I don't know what's problem.
Are you need gem list I installed?

https://gyazo.com/ec71f3b8d87f7454fc2ab83db8acb24e

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

But are you using Foreman?

from market_place_api.

 avatar commented on June 27, 2024

I use foreman as blow

11

but error is occur
222

my gem file like as blow

source 'https://rubygems.org'

gem 'rails', '4.2.4'
gem 'sass-rails', '> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '
> 4.1.0'
gem 'jquery-rails'

gem 'active_model_serializers', github: 'rails-api/active_model_serializers'

gem 'devise'

gem 'sabisu_rails', github: 'IcaliaLabs/sabisu-rails'
gem 'compass-rails', github: 'Compass/compass-rails', branch: 'master'
gem 'furatto', github: 'IcaliaLabs/furatto-rails'
gem 'font-awesome-rails'
gem 'simple_form'

gem 'sdoc', '~> 0.4.0', group: :doc

group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'sqlite3'
end

group :test do
gem 'byebug'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'ffaker'
gem 'shoulda-matchers', '>= 3.0.0', require: false
gem 'spring'

gem 'puma'

gem 'foreman'

REF)
432

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

You have to access the foreman server, so:

localhost:5000/sabisu_rails/explore

How does the sabisu initializer look like?

from market_place_api.

 avatar commented on June 27, 2024

Thank you. I success to see the page.
https://gyazo.com/a6b1fc142e2d28408c9b2f6530092b60

Really appreciate to you.

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

Sweet!

I'm closing the issue then

from market_place_api.

tarasmatsyk avatar tarasmatsyk commented on June 27, 2024

I have the same issue, probably I do something wrong here.
I tried prax and stopped on foreman. Here is my setup

Procfile

web: bundle exec puma -t 5:5 -p 3000 -e ${RACK_ENV:-development}

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 initializer

SabisuRails.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 3000

And I still get the error if I go to:

localhost:3000/sabisu_rails/explorer

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?

screenshot from 2015-11-10 23 08 08

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

If you are using prax, you have to include the port on the base_uri for the sabisu initializer such as:

SabisuRails.setup do |config|
  config.base_api_uri = 'api.marketplaceapi.dev:3000'
.
.
.

from market_place_api.

tarasmatsyk avatar tarasmatsyk commented on June 27, 2024

I thought it would work, however in this case I get the timeout error
screenshot from 2015-11-11 23 19 26

I tried prax and foreman as well. Nothing seems to be working.

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

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...

from market_place_api.

tarasmatsyk avatar tarasmatsyk commented on June 27, 2024

@kurenn,
so here is what I did:
Step 1. Console session 1.
screenshot from 2015-11-11 23 25 03

Step 2. Console session 2
screenshot from 2015-11-11 23 25 39

Here is my procfile

web: bundle exec puma -t 5:5 -p 4000 -e ${RACK_ENV:-development}

I tried both ports 4000 and 3000 and on both of them I get the same error
screenshot from 2015-11-11 23 26 50

here is my sabisu config
screenshot from 2015-11-11 23 27 16

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 :)

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

Are you using prax?

from market_place_api.

tarasmatsyk avatar tarasmatsyk commented on June 27, 2024

I do, the application is linked to prax. On the screenshots above I used foreman.
I hope it is a typical misconfiguration issue when something very small is missing and it is hard to spot it.

You can just put me on the right direction or the one you would started to investigate.

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

If you stop using prax, you have to configure the base_uri to something like:

config.base_uri = "localhost:4000/api"

And then you can access the explorer through localhost:3000/sabisu_rails/explorer.

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

from market_place_api.

tarasmatsyk avatar tarasmatsyk commented on June 27, 2024

Ok, finally it started to make sense for me.
The explorer seems to be working but now I have another issue.

Puma caught this error: Attempt to unlock a mutex which is not locked (ThreadError)

Give me some time and I will tell you whether the issue is still valid.
@kurenn, do you have an idea what was wrong with prax?

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

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 ;)

from market_place_api.

tarasmatsyk avatar tarasmatsyk commented on June 27, 2024

And this is the best thing I have ever seen in my life
screenshot from 2015-11-11 23 53 51

Now I am happy to stop thinking about django as the bigger out of the box feature provider .
Thank you very much, @kurenn !

If I can help you somehow with the fix, I am happy to give a try.

from market_place_api.

kurenn avatar kurenn commented on June 27, 2024

@tamatsyk Sure, I'll let you know!

I'm really happy you made it to work!

Enjoy!

from market_place_api.

lcastrooliveira avatar lcastrooliveira commented on June 27, 2024

Tried to make it work here and I had to give up :(
Too hard to get it working

from market_place_api.

premsaha24 avatar premsaha24 commented on June 27, 2024

start prax in the background

from market_place_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.