I had some errors occurring in my controller, but it wasn’t displaying in my views. So I had to figure out how to see what was happening since I didn’t see any messages in the logs that were helpful either.
I found the solution in one of the answers here on Stack Overflow.
By adding this to my controller (it was the creation of a model – @user):
This recorded the error in my logs (one of my model validations needed to be changed).
I was receiving the error “The plain HTTP request was sent to HTTPS port” error”, Nginx error 400. The problem was a an Nginx configuration error. I found the solution in this StackOverflow question. In the config file with your server info (mine was in /etc/nginx/sites-enabled/default):
make these changes:
listen 80; listen 443 default ssl; # ssl on - remember to comment this out
In order to create a SSL Certificate, you need to generate a CSR, or Certificate Signing Request. I ran into some issues when generating one from Windows, so I wanted to document the steps that I took.
- went to http://slproweb.com/products/Win32OpenSSL.html to download Win32 OpenSSL v1.0.0k
- installed OpenSSL
- I received an error regarding C++ during the install, so I installed Visual C++ 2008 Redistributables from the same page I downloaded OpenSSL
- Run a command prompt (cmd.exe from the search box in the Windows start menu)
- When I tried to run an OpenSSL command, I received an error that a file could not be found (WARNING: CAN’T OPEN CONFIG FILE: /USR/LOCAL/SSL/OPENSSL.CNF)
- As noted here, you have to set the environmental variable by typing this into the cmd: set OPENSSL_CONF=c:\[PATH TO YOUR OPENSSL DIRECTORY]\bin\openssl.cfg
- navigate to the bin directory
- enter your openssl command to generate your csr. For me, it was:
openssl req -nodes -newkey rsa:2048 -keyout myserver.key -out myserver.csr
- this created key and csr files I could use for creating my SSL certificate
When I had to set up a new Windows PC with Rails, I ran in to a mysterious error where I couldn’t view my app because of purported problems with my .coffee.js files. However, I knew there was no issue with the files since they were created during scaffolding and had only comments in them. Furthermore, I was able to run the same code on my other PC fine, as is.
When I viewed the –trace there was nothing of note (except listing that the coffee files had issues with them). When I tried to load the view, I did see this though “ExecJS::RuntimeError in Home#index”
Fortunately, I found the solution in this thread which explains that this is the result of Node.js not on a PC, or the path not set correctly in Windows environment variables. I downloaded the Windows installer (.msi) file and installed Node.js and added the path to the PATH environment variable. After I restarted my Rails server, the error went away.
I ran into an issue with my manifest.json file when trying to submit my app to the Google Chrome Store. I followed the directions, but apparently there was a detail that was so simple, it wasn’t documented. The documentation says to create a text file to put the manifest code, and then to save it as manifest.json. However, when I loaded my zip file, I kept receiving error messages saying that the manifest.json was not at the root level and couldn’t be found. The only thing was the file was of course there, and there were no subdirectories in my zip file.
It turned out to be a stupid, basic mistake.
When I looked at the properties of the file, the file was a .txt file, and the full name was actually manifest.json.text even though I couldn’t see the .txt part in Windows Explorer. I found the solution was that when the file was created, I should have named it manifest.json, but also when I saved it in Notepad, I should have selected “Save as type” as “All Files”. When you look at the properties, the file type will now be “json” instead of “txt”.
I was receiving a translation missing message that was showing up on my page views for my ActiveAdmin page. To correct this, I found the solution on Stack Overflow which said that these translations were just missing from my en.yml file in locales, and to replace my existing one with the one here (that ActiveAdmin uses):