Comments (7)
Мне так удобней, когда много разных проектов.
from omniauth-vkontakte.
Привет.
Да, сервер надо запускать на 80 порту и использовать host как в настройках приложения. Я для этих целей в development использую puma-dev или pow(для macOS). Так же можно запускать rails на 80 порту через sudo(не рекомендую так делать)
from omniauth-vkontakte.
ок. Решил для начала попробовать через sudo. Установил его для rbenv, выставил нужную связь в hosts и запускаю: rbenv sudo rails s -p 80
[sudo] password for user:
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:80
=> Runrails server -h
for more startup options
=> Ctrl-C to shutdown server
[2016-12-08 15:00:44] INFO WEBrick 1.3.1
[2016-12-08 15:00:44] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
Exiting
/home/user/.rbenv/versions/2.2.2/lib/ruby/2.2.0/socket.rb:232:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError)
я что-то делаю не так?
сразу же запускаю снова и тогда сервер запускается:
rbenv sudo rails s -p 80
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:80
=> Runrails server -h
for more startup options
=> Ctrl-C to shutdown server
[2016-12-08 15:01:14] INFO WEBrick 1.3.1
[2016-12-08 15:01:14] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
[2016-12-08 15:01:15] INFO WEBrick::HTTPServer#start: pid=4194 port=80
захожу на localhost, все работает, пытаюсь обратиться к /auth/vkontakte
и получаю ту же ошибку {"error":"invalid_request","error_description":"redirect_uri has wrong domain, check application settings"}
и вижу, что в запросе снова &redirect_uri=http%3A%2F%2Flocalhost%
from omniauth-vkontakte.
Попробуй заходить не на localhost
, а на xyz.ru
. Так же проверь не занят ли 80 порт. Возможно у тебя там висит Apache
from omniauth-vkontakte.
обратиться по xyz
не удается, выдает This site can’t be reached
а на 80-ом порту у меня висит вот что
sudo lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
plugin_ho 4359 glaux 20u IPv4 28468 0t0 TCP 192.168.0.100:39474->209-20-75-76.slicehost.net:http (CLOSE_WAIT)
chrome 4905 glaux 127u IPv4 47619 0t0 TCP 192.168.0.100:54414->sc-in-f114.1e100.net:http (ESTABLISHED)
ruby 5470 root 10u IPv6 51612 0t0 TCP ip6-localhost:http (LISTEN)
ruby 5470 root 11u IPv4 51613 0t0 TCP xyz.ru:http (LISTEN)
убить эти процессы не удается почему-то
from omniauth-vkontakte.
127.0.0.1 xyz.ru
точно прописан в /etc/hosts
?
from omniauth-vkontakte.
ок, разобрался. Видимо проблема была в кеше хрома, тк в другом браузере все заработало. Спасибо за помощь! :)
А почему лучше использовать puma-dev?
from omniauth-vkontakte.
Related Issues (20)
- Error on callback redirect HOT 1
- Unneeded API calls
- Update gem on rubygems please HOT 2
- Нет email адреса
- Работает ли данный модуль со Standalone приложениями? HOT 2
- Could not find a strategy with name `Vkontakte'. Please ensure it is required or explicitly set it using the :strategy_class option. (Devise::OmniAuth::StrategyNotFound) HOT 1
- redirect_uri is invalid, please pass same redirect_uri, you used in authorize method HOT 5
- ERROR -- omniauth: (vkontakte) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected HOT 2
- Getting 502 on callback HOT 2
- Offline Access HOT 9
- invalid_credentials: OAuth2::Error, invalid_grant: Code is invalid or expired HOT 1
- Add Rubocop
- Пустой request.env['omniauth.auth'] HOT 3
- client_id is incorrect HOT 5
- Bump omniauth-oauth2 version HOT 1
- [Question] Send token straight to omniauth_callback
- иногда выскакивает NoRawData HOT 2
- Creating a gem release for omniauth-oauth2 dependency update HOT 2
- {"error":"invalid_client","error_description":"client_id is undefined"} HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from omniauth-vkontakte.