我在Mac OS 10.8.5上安装了docker-machine 0.1.0和docker-compose 1.1.0.
Docker-machine正常运行,可以通过docker-machine ssh连接.
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
dev * virtualbox Running tcp://192.168.99.100:2376
Run Code Online (Sandbox Code Playgroud)
但无法从docker-compose连接.
$ docker-compose up
Run Code Online (Sandbox Code Playgroud)
我的Dockerfile和docker-compose.yml就在这里.
Dockerfile
FROM centos:centos7
DOCKER_HOST tcp://192.168.99.100:2376
Run Code Online (Sandbox Code Playgroud)
泊坞窗,compose.yml
web:
build: .
Run Code Online (Sandbox Code Playgroud)
为什么不能连接?有任何想法吗?
我正在开发Rails 3.1.1.
在Model中包含url_helpers会导致保存模型的ArgumentError.
class Medium < ActiveRecord::Base
include Rails.application.routes.url_helpers
.
.
end
class MediaController < ApplicationController
def create
@medium = Medium.new(params[:medium])
@media.save # => cause ArgumentError
end
end
Run Code Online (Sandbox Code Playgroud)
ArgumentError(缺少要链接的主机!请提供:host参数,设置default_url_options [:host],或将:only_path设置为true):
另一个包含url_helper的模型不会导致错误.
怎么了?
提前致谢.
我正在使用RSpec和rspec-rails 2.10进行测试.
我在环境.rb中将Rails时区设置为UTC,但RSpec时区成为我的本地时区,东京.
我在环境/ test.rb和spec_helper.rb上编写了Time.zone setteing,但没有修复.
如何设置RSpec时区?
我正在尝试更改主题中提升按钮主题属性中的提升按钮文本颜色,但无法更改。我知道 Text 子节点中的 TextStyle 可以更改 Text 的颜色,但我更喜欢在提升的ButtonTheme中定义。
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(title: 'Flutter Demo Home Page with 2.0'),
theme: ThemeData(
primaryColor: HexColor('#003f71'),
accentColor: HexColor('#e09e36'),
scaffoldBackgroundColor: HexColor('#003f71'),
textTheme: TextTheme(bodyText2: TextStyle(fontSize: 16.0), button: TextStyle(fontSize: 16.0)),
elevatedButtonTheme:
ElevatedButtonThemeData(style: ElevatedButton.styleFrom(minimumSize: Size(1, 45), primary: HexColor('#e09e36'), textStyle: TextStyle(fontSize: 16.0, color: Colors.black))),
),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: …Run Code Online (Sandbox Code Playgroud) CSS
.line-clamp{
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
Run Code Online (Sandbox Code Playgroud)
超文本标记语言
<div class="line-clamp">
<div>Line 1</div>
<div>Line 2</div>
<div>Line 3</div>
<div>Line 4</div>
<div>Line 5</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我正在尝试从 comment_users 表 user_id 列值更新 comments 表上的 user_id 列,其中 comment_id 与 comments 表 id 列匹配。
评论用户表
id: 5 comment_id: 1, user_id: 20
Run Code Online (Sandbox Code Playgroud)
之前的评论表
id:1 user_id: NULL
Run Code Online (Sandbox Code Playgroud)
后
id: 1 user_id: 20
Run Code Online (Sandbox Code Playgroud)
我执行了下面的sql,但它不起作用。
UPDATE comments
SET user_id = comment_users.user_id
INNER JOIN comment_users ON comment_users.comment_id = comments.id
WHERE comment_users.comment_id = comments.id
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN comment_users ON …Run Code Online (Sandbox Code Playgroud)