puma-dev link not working under Linux - ruby-on-rails

I'm work on Linux and I develop a Ruby on Rails application.
I've set up the puma-dev seeing this page and they say, if you are working on Linux, please setup dev-tld-resolver.
I have completed both setups and I want to test if they work correctly.
I linked puma-dev to my Rails app and run it in the foreground with the -sysbind option. It runs, but if I type the URL (myapp.dev), it does not work.
How can I solve this problem?

I solved the problem myself.
The problem was Firefox. Firefox not support .dev domain so it couldn't connect to my application.
As I turn my app with Google Chrome, it executed correctly.

Related

Rails app issue with URL

I deployed today on 2 different AWS environments (set up identically) the same version of our app.
On our second app, I have an issue when users click on a link.
Link should redirect to my_app/module#/page and instead, it redirects to my_app/module#!/#%2Fpage
Locally and on the first app, it works fine. I look and could not find the reason why encoding is changed in this instance.
They are both rails app. nginx used on both servers if that can help
Thanks.
Issue was due to Angular version on one of my apps.
After editing the package.json file and re deployed, everything is back to normal.
issue related: URL hash-bang (#!/) prefix instead of simple hash (#/) in Angular 1.6)

Rails server hanging even with even freshly created app

My rails server started hanging today, so I tried running different apps to see if the issue was caused by my app, even created an empty app and with that even the default page doesn't come up.
I've been using it as just an http server, testing front-end with adding files into the public folder, so, I don't even compile any actual ruby code, just plain HTML, CSS and JS.
When I try to browse localhost:3000, the page is unresponsive, I can't even view source and I'd like to add that this happens with Chrome, Safari, IE and Edge, so I don't think it's a caching issue on the browser front.
I tried running the server on a specific ip and port, also tried the 0.0.0.0 trick mentioned on some other questions, doesn't help me so far.
I'm using ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15] and Rails 4.2.5.
Any ideas?
Well, I ended up resolving the issue by uninstalling and reinstalling the whole stack. Couldn't find the reason behind the issue but if you get stuck with the same problem, apparently a complete reinstall fixes it...

WebSockets with SSL on Heroku - issues in Chrome and FireFox

I have a chat application hosted on Heroku that is using WebSockets. The app is Rails 4.0.1 and Ruby 2.0.0 and is using the gem 'websocket-rails'.
The application was working fine in Safari, Chrome and Firefox when I was using standard http://. Then today I added SSL endpoint on Heroku. Now, the app works fine in Safari, but in Chrome and Firefox it will take > 1 minute to load any page (even just a static page). It is getting hung up on something (I'm guessing the WebSocket connection) but I am having a hard time debugging the root problem. Any ideas or things to try would be greatly appreciated.
The app is: http://www.chat-correct.com. If you try it in Safari it should load the pages relatively fast, but if you try it in Chrome or Firefox you will see that it hangs.
I am using:
Safari Version 6.1 (8537.71)
Chrome Version 31.0.1650.39 beta
Firefox Version 22
UPDATE
I have narrowed the issue down and it seems to be with using the thin web server:
Thin web server (v1.6.1 codename Death Proof)
If I switch the app to WEBrick, the Chrome/Firefox issue disappears. However, the web socket-rails gem doesn't work with WEBrick and only seems to support only event machine based web servers (thus Unicorn/Puma is out of the question).
Try Rainbows!. http://rainbows.rubyforge.org/ It is based on unicorn and also can be configured to use EventMachine for network concurrency. Though to be fair, I ran into your question because I have a similar issue on rainbows. Anyway, I have a slightly different setup so it may not be an issue for you.

Cookies not saving

I'm working on an application in localhost:3000 and I just started working with cookies and can't get them to stay saved after I quit out of chrome. I checked my preferences and they were fine, cookies from other websites like stackoverflow are being retained. I've tried multiple ways of saving the cookies including
cookies.permanent[:guest_user_id] = create_guest_user.id
and it's not working (create_guest_user is a method for implementing a guest_user, taken from https://github.com/plataformatec/devise/wiki/How-To:-Create-a-guest-user). Also, Devise isn't saving anything either when I check remember me at the login page. I even added
Devise::TRUE_VALUES << ["on"]
as was recommended by another post and that didn't work for me either. I'm using rails 3.1.1, formtastic 2.0.2, and devise 1.5.1. I'm running Mac OS 10.6.8 and chrome 15.0.874.121. Thanks for the help.
UPDATE: I even tried changing my hosts file as was recommended here Can I use localhost as the domain when setting an HTTP cookie? and it still isn't working. Am I missing something obvious?
I guess there just isn't a relatively easy way of solving this problem in chrome. I tried out a bunch of solutions from various sources with little success. Not sure why google has this design in chrome as its developer tools are great and I'm reluctant to switch browsers.

rails 3 app - emails not sending

I've been setting up an rasil3 app that sends emails following this tutorial.
I've been working on it on two dev machines, one with passenegr/apache and the other using pow/apache. I'm working from the same git repo. I've not tried the app from Heroku/any other hosting yet.
The emails hae been sending from the machine with pow but not sending from the machine using passenger.
I've also been working on two different networks.
The machines are both osx. The one that is sending the emails is the most recent version of lion, the one that is not working is osx 10.6.7.
There are no errors showing in rails' development log. Should I be looking somewhere else?
Any idea why this would be the case? How should I debug something like this?

Resources