当我使用rails s命令启动rails server时,它正在显示A server is already running. Check C:/Sites/folder/Pids/Server.pids
当我打开文件时,它只输出一个4位数字,那么我怎么能解决这个问题呢?
FYI
cmd.exe显示没有正在运行的其他进程.(使用Windows).我正在学习rails并遵循这个主题.我坚持使用这种to_proc方法.我认为符号只是字符串的替代品(它们就像字符串,但在内存方面更便宜).如果还有其他我想念的符号,那么请告诉我.请以简单的方式解释什么to_proc方法和用途.
以下是我用于将我的mongodb版本从2.6.9升级到最新版本的命令,但它仍然显示我以前的版本.让我知道我在升级过程中遇到了什么问题.问题是mongod -version仍然显示升级后安装的旧版本.
我提到的文档 - Mongodb Docs
我遵循的步骤 -
结果 -
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
mongodb-org
1 upgraded, 0 newly installed, 0 to remove and 139 not upgraded.
Need to get 3,608 B of archives.
After this operation, 0 B of additional …Run Code Online (Sandbox Code Playgroud) 我的问题可能是愚蠢的,但说实话,我搜索了很多并取得了成功,但并未完成.
我在Windows 8中使用xampp.
我的主机文件如下所示.
127.0.0.1 localhost
127.0.0.1 www.mysite.com
Run Code Online (Sandbox Code Playgroud)
我的httpd-vhosts.config如下所示.
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerName www.mysite.com
ServerAlias mysite.com
DocumentRoot "C:/xampp/htdocs/mysite"
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
这适用于http.但是我启用了ssl.
当我打字http://localhost或者https://localhost,两者都很好.
当我输入http://mysite.com它时,
当我键入https://mysite.com它被重定向为,https://mysite.com/xampp/并显示xampp的默认欢迎页面.
我试过跟踪的事情.
1)而不是使用127.0.0.1,我尝试在httpd-vhosts.conf中使用*:80但结果是相同的.
2)而不是使用127.0.0.1,我尝试在httpd-vhosts.conf中使用*:443但是在重启时apache无法再次启动.
请告诉我如何通过域名而不是使用https或http的localhost访问我的网站.
我的index.html.erb代码 -
<h1>Listing products</h1>
<table border="1">
<% @products.each do |product| %>
<tr>
<td><%= product.title %></td>
<td><%= product.description %></td>
<td><%= image_tag(product.image_url, :class => 'list_image') %></td>
<td><%= product.price %></td>
<td><%= link_to 'Show', product %></td>
<td><%= link_to 'Edit', edit_product_path(product) %></td>
<td><%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Product', new_product_path %>
Run Code Online (Sandbox Code Playgroud)
和图像在app\assets\images..但仍然没有出现在前端的图像.
当Firebug它,我相信图像标签正确形成...让我知道我在这部分缺少什么.
<img src="/images/product1.jpg" class="list_image" alt="Product1">
Run Code Online (Sandbox Code Playgroud)
截图 -

图像也到位 - …
我想在magento中逃避字符串,但是当我使用时mysql_real_escape_string,我正在收到警告.
警告:mysql_real_escape_string()[function.mysql-real-escape-string]:无法通过套接字'/var/lib/mysql/mysql.soc .....连接到本地MySQL服务器
我找不到任何magento的核心mysql转义函数.所以我该怎么做?
我检查了我的httpd.conf文件,没有发现任何东西,让我知道我需要看的其他区域.
虽然我的其他链接工作得很好 -
http://localhost/phpmyadmin/ 要么 http://localhost/myprojects/
这就是我在httpd.conf文件中的内容 -
DocumentRoot "C:/xampp/htdocs"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
最后 - 是的,我在搜索之前搜索了很多,但在我的情况下找不到任何东西.
Apache正在工作 -

我的hhtpd.conf文件 - …
我正在为电影名称存储创建一个Ruby哈希.
当哈希的键是包含空格的字符串时,它可以正常工作.
如:
movies = {"Avatar" => 5, "Lord of the rings" => 4, "Godfather" => 4}
现在我试图用符号替换字符串的使用:
movies = {Avatar: 5, Lord of the rings: 4, Godfather: 4}
显然这不起作用.
Ruby如何处理符号命名中的空格?
我有两个div div1和div2.我希望div2被自动隐藏,但是当我点击previewdiv然后div2使其可见并div1隐藏.这是我试过的代码,但没有运气:(
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("div2").hide();
$("#preview").click(function() {
$("#div1").hide();
$("#div2").show();
});
});
</script>
<div id="div1">
This is preview Div1. This is preview Div1.
</div>
<div id="div2">
This is preview Div2 to show after div 1 hides.
</div>
<div id="preview" style="color:#999999; font-size:14px">
PREVIEW
</div>
Run Code Online (Sandbox Code Playgroud)