Rails localhost on mobile without any styling - ruby-on-rails

I am running the rails server using, rails server -b 0.0.0.0 so i can access the local server on my mobile too. Though it is accessible from my mobile but it is just showing the html part without any css or js. Can anyone tell me why ?

Impossible to know for sure without anymore info, but could it be because your phone isn't connected to the internet and you're using/linking to some external libraries which then naturally requires internet connection?

Related

Network change from WIFI to 3g/4g produces HTTP Status 503 on random static files

This issue is strange, and i've spend a couple of days trying to solve it but i'm completely lost. I've developed a webapp with CodeIgniter 3.0.6 + AngularJS 1.5.5 as main frameworks for front/backend.
The problem is when I change the iPhone/iPad network from WIFI to 3G/4G,
some random HTTP GET request to static files fail. The files aren't always the same, but it only fails on images and js scripts.
The HTTP GET Status Code is 503 - Service Unavailable, and opening the file's URL points to a static HTML file with the same error.
The weirdest thing is that the response header Server changes from WIFI request (Apache) to 3G/4G request (nginx).
File loaded properly:
File error:
There are also other headers that are different between WIFI and (X)G request.
PHP works fine, HTML and dynamic data load properly. The problem appears to be at the static resources request.
EDIT
I've checked several websites hosted in 1and1, different hosting packs, and i 've even checked other domains hosted in the shared host where my app is running and it happends everywhere. The only change is the number of failing files, and it's random.
EDIT 2
After test with other ios browsers (Firefox and Opera), the problem seems to be focus on Safari and Chrome. Maybe i should say Webkit, but Opera seems fine.
EDIT 3
I've found and article (in comments, repu problems) while searching for a way to handle angular $http request from an offline device.
I need to go deeply and perform the tests described in the link, but seems a problem with the Websockets and the proxy servers used by operators, Vodafone in this case.
did anyone else find this issue?
I will edit this post with the improvements you suggest or the info you need.

Debugging web app on ipad without Mac

I'm tasked with fixing a bug on the mobile version of a project I just came on (and still learning my way around it). Its a heavy use 24/7 kinda job, so not keen on the trial and error guess/upload/test style of debugging.The bug is that almost none of the controls, particularly tabs, respond to user "clicks" on the ipad. The app was developed in asp.net MVC4 and I work on windows 7 in vs2012.
We are not a mac shop, but still need to support the Ipad and phone.
This is probably a simple question: but my searching keeps taking me
here: iOS6 - removed console log for IPad - how to use web inspector on windows?
and here: Accessing iOS Safari Web Inspector from Windows Machine.
I need a way to gather actually diagnostics, like what would be available in web inspector, without having to acquire a mac.
Use weinre. It runs a webserver that that can repond to a bookmarklet or <script> to run a remote inspector.
weinre is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone.
Get NodeJS, NPM, and a webkit-based desktop browser to run it.
Homepage: https://people.apache.org/~pmuellr/weinre/
Docs: https://people.apache.org/~pmuellr/weinre/docs/latest/
To install with yarn:
yarn add --dev weinre
then because it's no longer maintained, you may get TypeError: mime.lookup is not a function when you try to use it, then you have to edit node_modules/connect/lib/middleware/static.js and change require('mime') to require('mime-types') on line 21 (thanks). Then start with
yarn run weinre
If you now open the url showed there, you'll see the bookmarklet you can use etc. (Note: If using this from other computers, you may have to open local firewall ports, and if debugging a https site you may have to add a reverse proxy with cors headers.)

How to call Java EE SOAP or REST services from mobile platform. etc Dxtreme, Jquery Mobile, Icenium

I want to develop mobile apps based on HTML, JS. It must work on any device etc iphone, ipad, android and windows phone...
I must use JAVA EE on server side. First I choosed Dxtreme. after I learned dxtreme, it is possible REST Service using ASP.NET Web API. But it is inpossible on Java EE. following error :
But call along #POST, #PUT and #DELETE methods throws error
"XMLHttpRequest cannot load http://www.restserver/Service/item. Origin
http://www.localhost:51140 is not allowed by Access-Control-Allow-Origin".
I believe there must be something that people must be using SOAP or REST Service on Mobile.
Which mobile framework is it possible ?
Please help me.
Thanks.
have You read About Phonegap?U can use phonegap to build application that can work around different Mobile platform.Its uses HTML5,CSS3,Javascript.Hope this helps you......
Generally, people access web services using RESTful interfaces on the server end. You can create that with ASP.NET Web API and many other server side frameworks of course. Your error, I'm guessing, but not sure, is from your client application. If I'm correct, you are probably running some simulator or the app within a browser client, and not one of the mobile framework simulators, and are running into the problem where the browser restricts your access to services on systems other than the site your started with. I.e. if you got to myboringwebpage.com and try to look up something on api.twitter.com within the app, the browser will stop you unless you add certain things to your web server/page telling the browser that that is OK. Look up "CORS". With Icenium, if you use the browser development environment "Mist" you will get those issues. If you use the Windows environment "Graphite" there is no such restriction. If you use the Intel HTML5 XDK at http://html5m.com/, it runs some process to get around those issues, while running a simulator in a browser. If you end up building PhoneGap apps, which you can using Icenium, appery.io, Intel HTML5 XDK, PhoneGap Build and others, the built app, installed on the phone, will not be restricted as an in-browser "app" would. However, I had problems with the Intel framework's XHR code handling all the different methods. Sorry this probably doesn't cover everything you need - you'll have to live and learn a lot of this.

Session errors when accessing a development Rails app through VirtualBox

I'm developing a Rails 3 app on Ubuntu 10.10 and need to check the CSS and Javascript on IE7 and IE8, so I'm using VirtualBox and the images that Microsoft provides. I've gotten the images installed and running well - I can use IE7 and IE8 to access the internet and use sites just fine.
I can also access my development Rails app (running on Ubuntu) by visiting 10.0.2.2:3000 in each browser (not sure why that works and localhost doesn't, but oh well). Any GET on a page that doesn't require the user to be logged in renders as I'd expect it to.
What's wrong are the sessions - as near as I can tell, both IE7 and IE8 are both just completely ignoring sessions with the development app. Whenever I submit the login form I get an InvalidAuthenticityToken error, and sure enough, in Rails' error page, the values in the session and params don't match. I even set up a special route to automatically log in the visitor as a random user, but it doesn't work. I just downloaded and installed Firefox in one of the virtual PCs and it's having the same problem as the IEs are.
Everything works perfectly in Chrome/Firefox in Ubuntu, so it doesn't seem to be Rails, and apparently it's not IE. I suppose there's something I'm missing with VirtualBox, but I have zero experience with virtualization before today, so I don't even know how to begin troubleshooting it.
Any advice?
Figured it out: The cookie wasn't being set because I was visiting the app through the ip address (Rails' :domain => :all option for the cookie store apparently doesn't cover that eventuality). I pointed lvh.me to 10.0.2.2 in the hosts file in WinXP, and everything works great.
I just had a similar problem on IE8, session cookies were turned off. My Rails app login worked after I turned session cookies to on via:
Internet Explorer > Tools > Internet Options > Privacy tab > Advanced button > tick "Always allow session cookies"

How to test Rails Juggernaut in Internet Explorer?

I'm having problem with my Rails application. I use juggernaut for server push, which works very nice in Firefox, Opera and Chrome, but it doesn't work at all in IE. It should be compatible with IE6+.
The problem is, that I can't find any debugging tools that can monitor network as Firebug does in Firefox. I tried IE debug bar, but there isn't anything about AJAX and network.
I'm running on default juggernaut settings and it doesn't even connect to the push server.
you could try using firebug lite http://getfirebug.com/lite.html
firebuglite is good tool.
If you are on a ruby on rails project, use firelite gem
https://rubygems.org/gems/firelite

Resources