Rails Server command not working - ruby-on-rails-4.2

I'm a complete newbie, starting to read "Rails 4 In Action" (Manning title) and have just installed Ruby, Rails, Gems, node.js, etc (as instructed by the book).
When I run the command "rails server," I get a response that's a lot like the one in this question:Rails server command not working (other commands, as well)
But none of the replies to that seem to shed much light on the cause of my problem. Here are the versions of Ruby, Rails, etc. that I'm running:
ruby 2.1.7p400 (2015-08-18 revision 51632) [i386-mingw32]
Rails 4.2.1
(Gem) 2.2.5
(DevKit) [INFO] found RubyInstaller v2.1.7 at C:/Ruby21
I downloaded node.js from http://nodejs.org (v4.2.2 LTS for Windows 64-bit)
I tried to cut & paste the response that I got when I entered the rails server command, but this "question" form didn't accept its formatting.
Any insights will be appreciated, thanks.
note that when I ran the Rails new command (rails new things_i_bought), I got this result:
exist
identical README.rdoc
identical Rakefile
identical config.ru
identical .gitignore
identical Gemfile
exist app
identical app/assets/javascripts/application.js
identical app/assets/stylesheets/application.css
identical app/controllers/application_controller.rb
identical app/helpers/application_helper.rb
identical app/views/layouts/application.html.erb
identical app/assets/images/.keep
identical app/mailers/.keep
identical app/models/.keep
identical app/controllers/concerns/.keep
identical app/models/concerns/.keep
exist bin
identical bin/bundle
identical bin/rails
identical bin/rake
identical bin/setup
exist config
identical config/routes.rb
identical config/application.rb
identical config/environment.rb
conflict config/secrets.yml

Have you tried rails server -b $IP -p $PORT?
This guide helped me a lot, I hope it will be useful:
https://www.railstutorial.org/book/beginning

Related

WordPress and React - Fronitity framework Internal Server Error

I tried this framework called Frontity. For the first try (run) everything was good, I had my demo page, and it worked well. I follow these instructions.
For the second compile I got these error, and a lot: There are multiple modules with names that only differ in casing.
Only change what I have done was this one (connecting my frontity to my WordPress): https://docs.frontity.org/getting-started/connecting-to-wordpress
(Again: for the first run, it was good.)
Nothing, literally nothing was changed, I do not even started any other software :)
After all this, I deleted everything, moved to another folder, started over the whole thing and for now I only get the same errors, and an Internal Server Error in my browser.
I have this issue with or without running the xampp server.
Any idea what went wrong?
Localhost WordPress (xampp), localhost:3000 Frontity (default), Windows 10, Chrome browser.
errors after compile
Your problem is here in the console output:
I'm not sure at which point those files with differing cases are
generated, but I think the following should fix your issue:
https://stackoverflow.com/a/53901224/2638310
Ensure that the path you used in your terminal has the correct
capitalization. For example if you're using git bash on Windows and
your project has the following path:
C:\MyProjects\project-X
If you access it using cd /c/myprojects/project-x (note the lack of
capital cases) and then run npm start you might face this problem.
The solution would be to consider the project path case-sensitive and
use it as follows:
cd /C/MyProjects/project-X

Unable to get python3 to work in Git on Windows10

I have installed the latest windows 10 version of Git v 24 and use the standard recommended install as shown on a number of websites including https://zarkom.net/blogs/how-to-install-git-and-git-bash-on-windows-9140
he has said that his install recommends for vers 19 are still ok for v24 and just click on Next etc. I have had this confirmed with other help guides but on install I type in after the $ sign either python and or python3 and nothing happens but I can see when running a test file the bash:
/c/Users/nigel/AppData/Local/Microsoft/WindowsApps/python3: Permission denied
I don't have python3 installed there but in standard C:\Users\nigel\AppData\Local\Programs\Python.
I have powershell running ok and am using Sublime Text 3 ok I can run code I prepare in Powershell version 5.6.. whatever it is now standard install part of Windows10. No issues running Python IDLE either.
When I search the reg with regedit and type in git bash I cannot trace this odd link to Microsoft/*/Python as above but in that folder there is an odd link not seen previously not sure what installed that other than sometime ago I might have started an instll of python via M store but sure I didn't but this odd python language server may have got installed through something else?
C:\Users\nigel\AppData\Local\Microsoft\Python Language Server\stubs.v1 is all I can find but in windowapps I found 0kb of a couple of files that are odd ie python.exe and python3.exe and size says 0kb.
I cant seem to find how to amend git so that it stops looking in this odd location and looks in correct folder as stated above ie C:\Users\nigel\AppData\Local\Programs\Python
I would appreciate any help although I am using powershell and ST3 ok on my python courses on UDEMY. I have tried to look at environmental path etc but cant see any reference to this odd path link with windowapps ? I have amended path ok previously for other editors or ensured that the path was pointing to correct python. The only other version of python I have is with Jupyter/ananconda but that is self contained my word ie it doesn't fire up unless I am in Anaconda or jupyter hope that makes sense which I use on another course ie bootcamp course

Install Git on CentOS 7 LEMP stack

After about 6+ days and numerous rounds of spin-up/destroy I have FINALLY gotten my Digital Ocean droplet server up and running (ie I can view a live page of content at my ip).
At this point I am trying to install Git, and have installed/removed it 3 times so far as I keep getting 'close' to completion but then run into some error I can't find an answer for. I'm hoping someone can help me figure out what my latest problem is so I can move forward with the actual development of my site rathe than spending over a week on the server build.
I have attempted to install version 2.6.2 of git on my server and have had to compile from source (something I am no where near familiar with). I 'thought' I had it correct this time, but received the following error when I attempted to set my git user name:
gitconfig --global user.name "MyUserName" (<--- last command I made)
bash: gitconfig: command not found (<-- error i received)
I thought it was an issue with being in the wrong directory to run the command, so i ran which git and received the following output:
/usr/local/git/bin/git
This seems to be a binary (?) file and none of the directories listed in that path allow me to use gitconfig command either.
Any ideas what I have done wrong? Do I need to remove (again!) and re-compile. I don't desire to be a server admin, but really had thought (hoped?) spinning my own LEMP server on CentOS 7 would be simple - doing so on CentOS 6.* was.
Thanks for your help/advice.
gitconfig isn't a command.
You'd do:
git config --global user.name "MyUserName"
Also you're really better off installing git via yum, rather than compiling from source unless there's a good reason to compile it yourself.
(Edit - updated answer with tested solution on Centos 7).

Invalid Argument Running Google Go Binary in Linux

I’ve written a very small application in Go, and configured an AWS Linux AMI to host. The application is a very simple web server. I’ve installed Go on the Linux VM by following the instructions in the official documentation to the letter. My application runs as expected when invoked with the “go run main.go” command.
However, I receive an “Invalid argument” error when I attempt to manually launch the binary file generated as a result of running “go install”. Instead, if I run “go build” (which I understand to be essentially the same thing, with a few exceptions) and then invoke the resulting binary, the application launches as expected.
I’m invoking the file from within the $GOPATH/bin/ folder as follows:
./myapp
I’ve also added $GOPATH/bin to the $PATH variable.
I have also moved the binary from $GOPATH/bin/ to the src folder, and successfully run it from there.
The Linux instance is a 64-bit instance, and I have installed the corresponding Go 64-bit installation.
go build builds everything (that is, all dependent packages), then produces the resulting executable files and then discards the intermediate results (see this for an alternative take; also consider carefully reading outputs of go help build and go help install).
go install, on the contrary, uses precompiled versions of the dependent packages, if it finds them; otherwise it builds them as well, and installs under $PATH/pkg. Hence I might suggest that go install sees some outdated packages which screw the resulting build.
Consider running go install ./... in your $GOPATH/src.
Or may be just selective go install uri/of/the/package for each dependent package, and then retry building the executable.

phantom-jasmine can not find specs

I am trying to use phantom-jasmine. I have installed phantomjs (1.9.1) on my systems ( Mountain Lion and Ubuntu) and phantom-jasmine using npm.
The problem is when I try to run phantom-jasmine examples/TestRunner.html from their example I am getting 0 specs, 0 failures although it should be 3 specs, 1 failures in the output.
If I open the TestRunner.html from a browser it is behaving as expected but phantom-jasmine cant seem to find the specs.
Another thing is when I provide the absolute path (phantom-jasmine /home/me/phantom-jasmine/examples/TestRunner.html to the TestRunner.html this happens
Not entirely sure why, but I got the examples running by omitting TestRunner.html from the call. Like this:
phantom-jasmine examples
It seems that the branch/version you get when installing using npm does not match what is described at https://github.com/jcarver989/phantom-jasmine.
Looking at the installed readme.md helped me.
I had the same problem. In the meantime, I ended up switching to a new set of scripts to run jasmine tests with phantomjs from the command line. See SenchaProSvcs/UnitTestDemo.
I faced the same issue with phantom-jasmine. In order to get this to work I relied on run_jasmine_test.coffee file from the phantom-jasmine repo. I copied this file (and the console-runner.js) in my repo and invoked the testRunner via phantomjs by running the following command in my terminal:
phantomjs lib/jasmine/run_jasmine_test.coffee testRunner.html
The output I got here was consistent with the output I got when I ran the testRunner.html directly in the browser.
Hope this helps.

Resources