我想在 ROR 中使用 ruby 导出 xlsx excel 文件,所以我安装 rubyXL。我使用这个命令: sudo gem install rubyXL --source http://rubygems.org然后它有如下错误
ERROR: Could not find a valid gem 'rubyXL' (>= 0), here is why:
Unable to download data from http://rubygems.org/ - Errno::ETIMEDOUT: Connection timed out - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
Run Code Online (Sandbox Code Playgroud)
请帮我
我使用certbot-auto来部署Let的加密SSL证书,并使用crontab -e更新证书,如下所示:
* 01 * * 1 /home/myname/certbot-auto --quiet
它有如下错误消息:
Bootstrapping dependencies for RedHat-based OSes...
yum is /usr/bin/yum
To use Certbot, packages from the EPEL repository need to be installed.
Please enable this repository and try running Certbot again.
我无法解决这个错误.请帮我!
我在VirtualBox上使用ubuntu 14.04.我尝试使用命令sudo apt-get install mysql-server安装mysql-server,我总是得到如下错误:
Some packages could be installed .This may mean that you have
request an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following packages have unmet dependencies:
mysqsl-server : Depends: mysql-server-5.5 but it is not going to be installed
E:Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
然后我尝试使用如下命令:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get clean …Run Code Online (Sandbox Code Playgroud) 我是ROR.i的新开发人员,使用带事件更改的ajax将show.html.erb中select_tag的数据发送到def show ... end中的控制器.我尝试发送数据,但我的脚本不工作.下面是我的脚本:
<script type="text/javascript">
$('#cbo').change(function() {
$.ajax({
url: "/product_details/show",
type: "POST",
data: {"cbo_id" : $('#cbo').val()},
dataType: "html",
success: function(data) {
alert('successfully');
}
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
在product_details/show.html.erb中
<%= form_tag(product_detail_path, :method => "post") do %>
<%= select_tag "categories", options_from_collection_for_select(Category.all, :id, :category_name),:id => 'cbo' %>
<% end %>
def show
@getcbo = params[:cbo_id]
end
Run Code Online (Sandbox Code Playgroud)
我认为url可能有问题:"/ product_details/show".那么我如何使用url将数据发送到def show ...在控制器中结束?.请帮我 !
我正在为我的域名使用 certbot-auto 生成证书 https。我使用这样的命令
sudo ./certbot-auto
Run Code Online (Sandbox Code Playgroud)
没关系,但是当我更新证书时使用命令
sudo ./certbot-auto renew --dry-run
Run Code Online (Sandbox Code Playgroud)
它无法更新证书并显示如下错误消息:
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
DeprecationWarning
Saving debug log to /var/log/letsencrypt/letsencrypt.log
-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/example.asia.conf
-------------------------------------------------------------------------------
Cert not due for renewal, but simulating renewal for dry run
Starting new HTTPS connection (1): acme-staging.api.letsencrypt.org
Renewing an existing certificate
Performing the following challenges:
tls-sni-01 challenge for example.asia
tls-sni-01 …Run Code Online (Sandbox Code Playgroud) 我想使用angularjs发送用户名和密码登录spring security而不是普通的login.jsp.我有一些配置如下:
-security_config.xml
<http use-expressions="true" auto-config="true">
<access-denied-handler error-page="/403page" />
<anonymous enabled="false" />
<intercept-url pattern="/api/**" access="hasRole('ROLE_USER')" />
<custom-filter ref="resourceServerFilter" before="PRE_AUTH_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler" />
<form-login login-page='/login' username-parameter="username"
password-parameter="password" default-target-url="/api/users"
authentication-failure-url="/login?authfailed" />
<logout logout-success-url="/login?logout" />
</http>
<authentication-manager alias="authenticationManager"
xmlns="http://www.springframework.org/schema/security">
<authentication-provider>
<password-encoder ref="encoder" />
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="select username,password, enabled from users where username=?"
authorities-by-username-query="select username, role from user_roles where username =? " />
</authentication-provider>
</authentication-manager>
<beans:bean id="encoder"
class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder">
<beans:constructor-arg name="strength" value="10" />
</beans:bean>
Run Code Online (Sandbox Code Playgroud)
-LoginController.java
@RequestMapping("login")
public ModelAndView getLoginForm(@RequestParam(required = false) String authfailed, String …Run Code Online (Sandbox Code Playgroud) 我尝试查询连接拖表 customer 和 mainorder 表。当我查询时总是出错
-客户.java
package com.mdr.model;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
//import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
*
* @author Sothon
*
*/
@Entity
@Table(name = "customer")
public class Customer{
@Id
@GeneratedValue
@Column(name="id")
private long id;
@Column(name="name")
private String name;
@Column(name="person")
private String person;
@Column(name="mail")
private String mail;
private int packFlg;
public long getId() {
return id;
}
public void setId(long id) {
this.id …Run Code Online (Sandbox Code Playgroud)