top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Why does the rails server default to port 3000?

+1 vote
449 views
Why does the rails server default to port 3000?
posted Sep 18, 2014 by Meenal Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Because DHH decided so, not any other reason

1 Answer

–1 vote

Typically used development instance but in production its of 80

answer Sep 25, 2014 by Arun Gowda
Similar Questions
+1 vote

In my local machine I had input some data into database using SQLite3 . When I deployed it to heroku why I can't get data that i input?

I'm doing like this

-in Gemfile
group :development do
 gem 'sqlite3'
end
group :production do
 gem 'pg'
 gem 'rails_12factor'
end
-bundle install
-heroku login
-git init 
-git add .
-git commit -m "test"
-git create
-git push heroku master
-heroku run rake db:migrate

How can I get some data when I deployed it to heroku? Please help me.

0 votes

When I view the output of the top command on ubuntu, I notice sometimes there is 6 ruby processes. When are each of these processes spawned?
http://tinypic.com/view.php?pic=2i24rwh&s=5

I cannot imagine that it's every time someone loads the rails application from a different ip address, otherwise I would assume there would be more ruby processes spawned.

+4 votes

I've been trying to set default URL parameters in the controller, which will also be used within the view. This is what I've got:

@params = params

defaults = { :date_from => '21/1/21014', :date_to => '21/2/21014', :data=>"Expense" }
if @params.any?
 @params = defaults.merge(@params)
else
 @params = defaults
end

.. seems messy, and doesn't work :( When params are present it still uses the default params. Not sure where it's going wrong and search on google yields many varieties. I know using default values in methods is something that I will repeat again so I was wondering what the best practice is for handling this.

+1 vote

I'm wonder how most people securely connect to a Postgres database on a server separate from the app server.

The ActiveRecord docs for a MySQL connection have explicit SSL options, whereas with Postgres it seems one would pass SSL options as documented for libpq.

However a quick Googling returns SO threads with suggestions to use SSH tunnels. Which I guess could be managed with something like AutoSSH.

I'd love to hear from others. Is one method faster than the other, or easier to maintain?

+1 vote

I was working on a test app and everything was going great. However now when I run "rails server" and none of the changes to the controller files are reflected.

If I make changes to HTML files, those are reflected. And yes, I'm sure am in the right directory editing the correct files.

I can get rid of actions in the controller files and it still works fine. Do I have to do something after I change the ruby files? I thought I could just save them then run 'rails server'... It had seemed to be working doing just that previously.

...