rails s -p214 的 把 rails 跑在 214 端口了,然后用 nginx 做了代理,绑定到了域名上 blog.rubyless.com/posts 上面,不过在新建 post 的时候,总是会返回 localhost 的连接上。怎么办呢?
粗线了这个问题: /usr/local/ruby/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in `resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified) 因为数据库配的是 development 所以自己把 production 换成 development 也不行。。。
developmengt:
adapter: mysql2
database: blog
pool: 5
username: root
encoding: utf8
host: localhost
password:
production:
adapter: mysql2
database: blog
poll: 5
username: root
encoding: utf8
host: localhost
password:
不过还是一样
ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.13) lib/rails/engine.rb:479:in `call'
railties (3.2.13) lib/rails/application.rb:223:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
/usr/local/ruby/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/usr/local/ruby/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/usr/local/ruby/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Started POST "/posts" for 221.228.228.14 at 2013-04-17 07:24:05 +0000
Processing by PostsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"tmnOm/msN5fGIqpXUhq3TVoUImGsKNxJy8s8CSWoN9Q=", "post"=>{"title"=>"231388", "content"=>"2132188"}, "commit"=>"Create Post"}
Redirected to http://127.0.0.1:214/posts/7
Completed 302 Found in 15ms (ActiveRecord: 2.1ms)