Rails server will not stop and even if it is running it is not working - ruby-on-rails

I am new to Ruby on Rails, but I managed to install it using the RailsInstaller and I am using Aptana Studio 3 as a text editor. I am on a Windows 7 x64.
Last week I managed to create a simple Hello world project, and it worked as it should when starting and stopping the rails server. To start the server I used the command rails server and to stop it I used CTRL+C.
Somehow, this week, when I'm trying to start the server it says "A server is already running". But, when I go to the correct page in a web browser it doesn't work. I get the error "Google Chrome could not connect to localhost:3010". So, this makes it seem like the server is not working, even though it supposedly is running.
So, I then try to stop the server from running, but CTRL+C doesn't seem to do anything. It doesn't give any kind of message at all when I input that, it just skips to a new line in the terminal window.

the standard port is 3000.
You can kill the server in the task manager and start it from new..

There is probably a rails process still running but bugged out/crashed. Try looking at the processes in the windows task manager to for a rails process, and cancel it. Additionally you can start a rails process on a different port with rails server -p PORT

Related

local rails engine running server but not console

An application can start the Thin web server
rails s
However, launching the console
rails c
hangs and never returns to a prompt.
Obviously, I need it to run!
note 1: I believe this is a consequence of an external disk that houses the application, that lost its connection to the main computer
note 2: I had read incidentally that the spring gem has some un-robust behaviours. Could this be a motive?
run following command & it should be fix
spring stop

Can't restart rails server (only hard reset helps)

Im usuing standart WEBrick server in my development environment
1) I run server via rails s
2) Then I do ctrl-C to shut it down
3) Use rails s one more time and following error appears
Therefore, each time I have to restart server, I kill process from /tmp/pids/server.pid and delete .pid file, which is an pain...
Any ideas why this might happens?
Since you are in RubyMine (RM), my suggestion would be to (slightly) alter how you use/control your server.
Instead of opening a Terminal and typing rails s, use the available server configuration from RM.
When chosen, it will start your server and give you a new panel just for controlling your server:
The cool thing here is that there is a start/restart button (showing the restart icon in my screen shot since I just started the server). When you're ready to restart the server for any reason, just open this panel and click that restart button (or click the stop button and then click the start icon if you prefer).
I've had a few little, niggling issue with RM's implementation of a Terminal but never had issues with my server management from RM using this approach.
I did notice in your original screenshot that you do have two Terminal windows open (Local and Local(1)). If you stick with the Terminal approach to server management in RubyMine, that may be part of the issue (I recall getting myself into 'trouble' in particular when I opened multiple Terminal shells in RM)

Running Ruby on Rails app on server

I am using Aptana Studio 3 for development of ROR apps. I used run server command and it showed you can access your app on {http//0.0.0.0:3000/}, but when I try to access this URL, it tells me to check your Internet connection. I tried several other ports also but it is not working. I have created/modified the files necessary and migrated the database successfully too. Appreciate any help in running the app over the browser. I am currently using WeBrick Server.
so, in your title you say "on server". what does that mean? when you are running it on a different machine than your own, you need to use the address of that machine or it's domain name. keep in mind that firewall rules might prevent any connection to that server.
when you are ON the machine, via ssh for example, you can try calling the then "local" rails instance with curl http://localhost:3000/ to verify that it is running.

Vagrant and RoR

I'm very new with Rails and I've installed Vagrant to run the Rails server. I've started the server and am able to load localhost:3000, now I don't know where to go. The command line is blank and I read that I should type in "script/console", but all I can really do is ctrl-C or -d.
When I tried to run Vagrant in a separate Window with "vagrant up" it says I need to do "Vagrant init"
Where do I go from here so that I can start going through my tutorials/start developing?
This screencast from RailsCasts should get you started. Some of the suggestions are a bit out-dated but by reading the show notes and comments, you should be able to get up and running. From there you can modify.
While getting Rails set up initially with Vagrant will be work, it's an incredibly handy tool to have experience with. It becomes even more useful when you incorporate a provisioning tool like Puppet.
In your terminal if you are running the webrick server via rails server you either need to background it or open a new terminal to get your shell prompt back. If you ctrl-C out of it you will kill the server. Keep in mind, the webrick server should only be used for local development. It's not a production level web server. See the Rails Getting Started guide for more details.
If you are going to run your rails server in a Vagrant VM, you'll need to configure the port forward in your Vagrantfile so you can access from your host machine.
config.vm.forward_port 3000, 9080
There error you are seeing would be from you running vagrant up in a directory that doesn't contain a Vagrantfile.

Rails Dev Server not visible on network

Trying to do something very basic and test my Rails app on my phone.
Starting the server with:
rails s
But when accessing mymachinename.local:3000, Mobile Safari says that the server stopped responding after about 30 seconds.
I do this all the time on other machines, but I have no idea what could be causing it here. Any suggestions?
I've had a similar issue before trying to access the server from a virtual machine, I had to use the following format for the rails server command:
rails s -b your.dev.ip.address
Whoops. Firewall. Don't know why I even had it turned on.

Resources