How I use to learn ROR in native?
ThreeStar opened this issue · comments
Hi guy,
I am really a fresh man for ROR,and I also have not develop web application,because I can not found anyone that is good enough for me.But I have read many resource about ROR,I decide to try.
I have read the start guide from http://guides.rubyonrails.org,so I have made a very simple demo for blog.but I also don't know how to write a better project by myself.I need a unabridged project to learn it.But I don't want to publish it to Host,only in my computer.
How could I use it to learn ROR in native?
Any idea will be appreciate.Thanks in advance!
Blues
When I run the command "rails server",I have got many issues,they are:
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in initialize': could not connect to server: Permission denied (PGError) Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in
new'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in connect' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:326:in
initialize'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in new' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in
postgresql_connection'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in new_connection' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in
checkout_new_connection'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in block (2 levels) in checkout' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in
loop'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in block in checkout' from /Users/Blues/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/monitor.rb:211:in
mon_synchronize'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in checkout' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in
block in connection'
from /Users/Blues/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/monitor.rb:211:in mon_synchronize' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in
connection'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in retrieve_connection' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in
retrieve_connection'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in connection' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/model_schema.rb:308:in
clear_cache!'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.11/lib/active_record/railtie.rb:97:in block (2 levels) in <class:Railtie>' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:418:in
_run__751346259397607869__prepare__2696965486316187750__callbacks'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in __run_callback' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in
_run_prepare_callbacks'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in run_callbacks' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:74:in
prepare!'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:48:in prepare!' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/application/finisher.rb:47:in
block in module:Finisher'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in instance_exec' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in
run'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/initializable.rb:55:in block in run_initializers' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in
each'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in run_initializers' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/application.rb:136:in
initialize!'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in method_missing' from /Users/Blues/Sites/mystory/config/environment.rb:8:in
<top (required)>'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/backports-2.6.7/lib/backports/tools.rb:314:in require' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/backports-2.6.7/lib/backports/tools.rb:314:in
require_with_backports'
from /Users/Blues/Sites/mystory/config.ru:3:in block in <main>' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.4/lib/rack/builder.rb:51:in
instance_eval'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.4/lib/rack/builder.rb:51:in initialize' from /Users/Blues/Sites/mystory/config.ru:in
new'
from /Users/Blues/Sites/mystory/config.ru:in <main>' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.4/lib/rack/builder.rb:40:in
eval'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.4/lib/rack/builder.rb:40:in parse_file' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.4/lib/rack/server.rb:200:in
app'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in app' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.4/lib/rack/server.rb:304:in
wrapped_app'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.4/lib/rack/server.rb:254:in start' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in
start'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/commands.rb:55:in block in <top (required)>' from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/commands.rb:50:in
tap'
from /Users/Blues/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.11/lib/rails/commands.rb:50:in <top (required)>' from script/rails:6:in
require'
from script/rails:6:in `
It that the reason which I don't install PostgresSQL database?
Thanks,
Blues
Hello. I don't know exactly about what happened, you need install and run a database. And postgresql is good.
Search your questions in googlestable.com and site stackoverflow.com You can get the answer. Good luck!
Follow the guide of RoR is best way learn RoR.
And also you can use Sinatra. Because Sinatra is much easier than RoR for Web Developer. Sinatra is great!
Thanks guy~
I want to use your "mystory" to learn ror,and when I run the command "rails server",it give me the errors like above.I don't know how to fix it.
@ThreeStar
Your database isn't set up correctly, several things might take place:
- You didn't properly install Postgresql, if so, please look at this blog post
- You do not have permission to access your database table. If so, look at this stackoverflow post
Hope this helps.