Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 获取lynx:Can';无法访问rails的启动文件错误_Ruby On Rails_Ruby On Rails 3_Lynx - Fatal编程技术网

Ruby on rails 获取lynx:Can';无法访问rails的启动文件错误

Ruby on rails 获取lynx:Can';无法访问rails的启动文件错误,ruby-on-rails,ruby-on-rails-3,lynx,Ruby On Rails,Ruby On Rails 3,Lynx,我有一个简单的登录系统,我使用Desive gem进行身份验证,我部署在服务器上,并使用lynx浏览器进行测试 我遵循了与该设计相关的所有步骤。 我已将我的根页面设置为设计登录页面,因此我的route.rb如下所示 devise_for :users devise_scope :user do root :to => "devise/sessions#new" end resources :home,:only => [:index, :das

我有一个简单的登录系统,我使用Desive gem进行身份验证,我部署在服务器上,并使用lynx浏览器进行测试 我遵循了与该设计相关的所有步骤。 我已将我的根页面设置为设计登录页面,因此我的route.rb如下所示

devise_for :users      
  devise_scope :user do
    root :to => "devise/sessions#new"
  end    
  resources :home,:only => [:index, :dashboard]
  resources :device_info,:only => [:address_list]     
  match ':controller(/:action(/:id))(.:format)'
我的数据库使用RDS连接。my database.yml文件如下

development:
  adapter: mysql2
  encoding: utf8
  reconnect: true
  database: abc
  pool: 5
  username: root
  password: root
  port: 3306
  host: 127.0.0.1

test:
  adapter: mysql2
  encoding: utf8
  reconnect: true
  database: abc
  pool: 5
  username: root
  password: root
  port: 3306
  host: 127.0.0.1

production:
  adapter: mysql2
  encoding: utf8
  reconnect: true
  database: abc
  pool: 5
  username: root
  password: root
  port: 3306
  host: xxxxxxxxxx.xxx.amazonaws.com
当我启动服务器并输入地址为lynx 0.0.0.0:3000时,它给我的错误是

Looking up 0.0.0.0 first
Looking up 0.0.0.0:3000
Making HTTP connection to 0.0.0.0:3000
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Unexpected network read error; connection aborted.
Can't Access `http://0.0.0.0:3000/'
Alert!: Unable to access document.    
lynx: Can't access startfile 
首先,我认为这可能是由于数据库未连接到应用程序,但通过使用rails控制台,我可以访问数据库。我还检查了日志文件,它不会显示任何错误。我错过什么了吗

这里我使用的是rails 3.2.11和ruby 1.8.7


我该怎么办?

我也有同样的情况。这是因为您无法访问端口3000。 您必须在iptable中打开端口3000。 您可以使用
iptables-I INPUT 1-ptcp--dport 3000-j ACCEPT
命令在iptable中打开端口

您也可以参考以下链接