无法连接到Fedora 21上的rails服务器(Cannot connect to rails server on Fedora 21)
我启动了
rails server
但是http://192.168.56.104:3000
不可用。 它的地址是正确的,因为我可以在http://192.168.56.104:80
看到Apache的测试页面。我启动了服务器:
$ rails s Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring. => Booting WEBrick => Rails 4.2.0 application starting in development on http://localhost:3000=> Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2015-03-10 09:45:49] INFO WEBrick 1.3.1 [2015-03-10 09:45:49] INFO ruby 2.1.5 (2014-11-13) [x86_64-linux] [2015-03-10 09:45:49] INFO WEBrick::HTTPServer#start: pid=5512 port=3000
然后它正在工作:
# wget http://localhost:3000; head index.html --2015-03-10 09:53:39-- http://localhost:3000/ Resolving localhost (localhost)... ::1, 127.0.0.1 Connecting to localhost (localhost)|::1|:3000... connected. HTTP request sent, awaiting response... 200 OK Length: 14935 (15K) [text/html] Saving to: ‘index.html’ index.html 100%[=================>] 14.58K --.-KB/s in 0.001s 2015-03-10 09:53:39 (18.1 MB/s) - ‘index.html’ saved [14935/14935] <!DOCTYPE html> <html> <head> <title>Ruby on Rails: Welcome aboard</title> <style media="screen"> body { margin: 0; margin-bottom: 25px; padding: 0; background-color: #f0f0f0;
IP:
# ip r default via 10.0.2.2 dev enp0s3 proto static metric 1024 10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15 192.168.56.0/24 dev enp0s8 proto kernel scope link src 192.168.56.104
防火墙设置是:
# firewall-cmd --list-all FedoraServer (default, active) interfaces: enp0s3 enp0s8 sources: services: cockpit dhcpv6-client http ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules:
和:
# firewall-cmd --permanent --zone=FedoraServer --list-all FedoraServer (default) interfaces: sources: services: cockpit dhcpv6-client http ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules:
和:
# cat /etc/firewalld/services/http.xml <?xml version="1.0" encoding="utf-8"?> <service> <short>WWW (HTTP)</short> <description>HTTP is the protocol used to serve Web pages. If you plan to make your Web server publicly available, enable this option. This option is not required for viewing pages locally or developing Web pages.</description> <port protocol="tcp" port="3000"/> <port protocol="tcp" port="80"/> </service>
我正在使用Fedora 21。
# cat /etc/fedora-release Fedora release 21 (Twenty One)
我应该检查和修复什么?
I started
rails server
buthttp://192.168.56.104:3000
is not available. Its address is correct because I can see the test page of Apache athttp://192.168.56.104:80
.I started the server:
$ rails s Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring. => Booting WEBrick => Rails 4.2.0 application starting in development on http://localhost:3000=> Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2015-03-10 09:45:49] INFO WEBrick 1.3.1 [2015-03-10 09:45:49] INFO ruby 2.1.5 (2014-11-13) [x86_64-linux] [2015-03-10 09:45:49] INFO WEBrick::HTTPServer#start: pid=5512 port=3000
Then it is working:
# wget http://localhost:3000; head index.html --2015-03-10 09:53:39-- http://localhost:3000/ Resolving localhost (localhost)... ::1, 127.0.0.1 Connecting to localhost (localhost)|::1|:3000... connected. HTTP request sent, awaiting response... 200 OK Length: 14935 (15K) [text/html] Saving to: ‘index.html’ index.html 100%[=================>] 14.58K --.-KB/s in 0.001s 2015-03-10 09:53:39 (18.1 MB/s) - ‘index.html’ saved [14935/14935] <!DOCTYPE html> <html> <head> <title>Ruby on Rails: Welcome aboard</title> <style media="screen"> body { margin: 0; margin-bottom: 25px; padding: 0; background-color: #f0f0f0;
IP:
# ip r default via 10.0.2.2 dev enp0s3 proto static metric 1024 10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15 192.168.56.0/24 dev enp0s8 proto kernel scope link src 192.168.56.104
Firewall settings are:
# firewall-cmd --list-all FedoraServer (default, active) interfaces: enp0s3 enp0s8 sources: services: cockpit dhcpv6-client http ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules:
and:
# firewall-cmd --permanent --zone=FedoraServer --list-all FedoraServer (default) interfaces: sources: services: cockpit dhcpv6-client http ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules:
and:
# cat /etc/firewalld/services/http.xml <?xml version="1.0" encoding="utf-8"?> <service> <short>WWW (HTTP)</short> <description>HTTP is the protocol used to serve Web pages. If you plan to make your Web server publicly available, enable this option. This option is not required for viewing pages locally or developing Web pages.</description> <port protocol="tcp" port="3000"/> <port protocol="tcp" port="80"/> </service>
I'm using Fedora 21.
# cat /etc/fedora-release Fedora release 21 (Twenty One)
What should I check and fix?
原文:https://stackoverflow.com/questions/28954632
更新时间:2021-08-15 21:08
最满意答案
然后尝试相反的:
Cells(23, 2).NumberFormat = "dd/mmmm/yy" Cells(23, 2) = EmployeeStartDatePicker.Value
Try the opposite then:
Cells(23, 2).NumberFormat = "dd/mmmm/yy" Cells(23, 2) = EmployeeStartDatePicker.Value
相关问答
更多-
默认日期始终为今天,将其设置为其他日期 $( "#datepicker" ).datepicker({ changeMonth : true, changeYear : true, yearRange : '1999:2005', defaultDate : '12/01/99' }); 小提琴 The default date is always today, set it to something else $( "#datepicker" ).datepicker({ ch ...
-
DatePicker.updateDate()的月份参数从零开始。 从文档 : 月 从零开始的月份。 因此,作为第二个参数,使用Integer.parseInt(spli[1]) - 1 DatePicker.updateDate()'s month argument starts from zero. From the documentation: month The month which is starting from zero. So, as the second argument, use In ...
-
我用这篇文章解决了这个问题: https : //github.com/flutter/flutter/issues/19744 我基本上从这里删除OK和CANCEL按钮,并添加到选择日期时自动按下datepicker上的一个DATE 。 在yout datapicker.dart中: void _handleYearChanged(DateTime value) { _vibrate(); setState(() { _mode = DatePickerMode.day; ...
-
然后尝试相反的: Cells(23, 2).NumberFormat = "dd/mmmm/yy" Cells(23, 2) = EmployeeStartDatePicker.Value Try the opposite then: Cells(23, 2).NumberFormat = "dd/mmmm/yy" Cells(23, 2) = EmployeeStartDatePicker.Value
-
日期时间选择器引导程序(date time picker bootstrap)[2023-07-02]
您提供的链接上datetimepicker的区域设置值是language: 'pt-BR' 。 将其更改为“en-US”或任何其他有效值, 以获得日期时间的正确时区 。 the locale value for datetimepicker on the link you provided is language: 'pt-BR'. Change it to 'en-US' or any other valid value to achieve correct timezone for datetime . ... -
大概。 这取决于您在日期选择器中选择的日期。 NSDate和Date将Date存储为自参考日期(即UTC 2000年1月1日开始)以来的秒数。 它看起来像您的日期选择器的UTC值是2017年5月31日9:00 UTC。 Probably. It depends on what date you had selected in the date picker. NSDate and Date store the date as the number of seconds since a reference d ...
-
对于DatePicker,请从Android网站查看此示例 。 private TextView mDateDisplay; private Button mPickDate; private int mYear; private int mMonth; private int mDay; static final int DATE_DIALOG_ID = 0; protected void onCreate(Bundle savedInstanceState) { super.onCreate( ...
-
您可以使用工具 ,或者您需要使用ControlCollection.AddDateTimePicker方法在MSDN上显示的程序。 You can use a Tool for that or you need to do it programmaticaly like shown on MSDN using ControlCollection.AddDateTimePicker Method
-
android上的输入日期选择器在WebView上显示错误的选择器(input date picker on android shows wrong picker on WebView)[2022-07-19]
正如评论中所讨论的,您可能错过了正确的主题。 鉴于您可以访问工作应用程序,请应用相同的主题,它应该解决它 As discussed in comments, you are likely missing the proper theme. Given that you have access to working app, please apply the same theme, it should solve it -
你可以像这样特别禁用日期。 /** Days to be disabled as an array */ var badDates = ["02-06-2015", "02-07-2014"]; function DisableSpecificDates(date) { var string = $.datepicker.formatDate('mm-dd-yy', date); return [badDates.indexOf(string) == -1]; } $(functio ...