小编Dan*_*nds的帖子

PDOException SQLSTATE [HY000] [2002]没有这样的文件或目录

我相信我已成功将我的(非常基本的)站点部署到fortrabbit,但是一旦我连接到SSH运行一些命令(例如php artisan migratephp artisan db:seed),我收到一条错误消息:

[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
Run Code Online (Sandbox Code Playgroud)

在某些时候,迁移必须有效,因为我的桌子在那里 - 但这并不能解释为什么它现在不适合我.

php mysql pdo laravel

280
推荐指数
16
解决办法
42万
查看次数

使用PHPStorm或POSTman的XDebug和RESTful服务器

如何使用REST客户端(例如PHPStormPOSTman内置的客户端)与XDebug一起使用?

在我目前的XDebug设置中,使用PHPStorm和Bookmarklet提供了我能够在Chrome和Firefox中使用它 - 但是当我尝试使用POSTman或任何其他REST客户端时,我无法弄清楚如何开始吧.

干杯.

rest xdebug phpstorm

70
推荐指数
3
解决办法
6万
查看次数

在Ubuntu 14.04上rbenv构建失败

我已经在我的Ubuntu 14.04桌面上成功安装了rbenv(以及构建工具),这似乎工作正常,但是当我尝试安装ruby 2.1.1时,构建失败:

daniel@grape:~$ rbenv install 2.1.1
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /home/daniel/.rbenv/versions/2.1.1

Downloading ruby-2.1.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/e57fdbb8ed56e70c43f39c79da1654b2
Installing ruby-2.1.1...

BUILD FAILED

Inspect or clean up the working tree at /tmp/ruby-build.20140418142258.3543
Results logged to /tmp/ruby-build.20140418142258.3543.log

Last 10 log lines:
installing default ripper libraries
compiling ossl_pkcs7.c
compiling ossl_ssl.c
installing default openssl libraries
linking shared-object openssl.so
make[2]: Leaving directory `/tmp/ruby-build.20140418142258.3543/ruby-2.1.1/ext/openssl'
linking shared-object ripper.so
make[2]: Leaving directory `/tmp/ruby-build.20140418142258.3543/ruby-2.1.1/ext/ripper'
make[1]: Leaving directory `/tmp/ruby-build.20140418142258.3543/ruby-2.1.1'
make: *** [build-ext] Error 2
Run Code Online (Sandbox Code Playgroud)

日志文件的内容可以在这里找到:http: …

ruby ubuntu rbenv

22
推荐指数
1
解决办法
7015
查看次数

使用子模块进行git部署

我一直在研究使用git部署站点的不同方法,并找到了以下教程:

http://42pixels.com/blog/quick-and-dirty-git-deployment

我喜欢本教程中提出的想法,并且热衷于将它用于我的网站,只是它似乎不支持子模块.

无论如何,这可以改变,以便子模块也被拉入并根据需要更新?

谢谢.

UPDATE

我在过去的几个小时里一直在研究这个问题,而且我似乎在取得进展,但我仍然无法让它发挥作用.

我已经切换到这个教程:http://toroid.org/ams/git-website-howto(大致相同,只是一些细微的变化),并在遵循一些建议后发现:https:// stackoverflow .com/a/6636509/1049688我最终得到了一个接收后的文件,如下所示:

#!/bin/sh

export GIT_WORK_TREE=/srv/www/limeblast.co.uk/htdocs_test
export GIT_DIR=/srv/www/limeblast.co.uk/.git
cd $GIT_WORK_TREE

git checkout -f master
git submodule init
git submodule update
Run Code Online (Sandbox Code Playgroud)

理论上这一切似乎都很好,并且看起来子模块命令正在运行,但我收到以下错误消息:

remote:子模块'wordpress'(git://github.com/WordPress/WordPress.git)注册路径'wordpress'remote :子模块'wp-content/themes/limeblastevolution/inc/cssCrush'(git:// github. com/peteboere/css-crush.git)注册路径'wp-content/themes/limeblastevolution/inc/cssCrush'remote :致命:工作树'/srv/www/limeblast.co.uk/htdocs_test'已经存在. remote:将'git://github.com/WordPress/WordPress.git'克隆到子模块路径'wordpress'失败

有任何想法吗?谢谢.

git git-submodules

6
推荐指数
1
解决办法
3221
查看次数

使用capybara-webkit填写编辑器textarea

我正在我的页面上使用降价编辑器,我正在尝试定位,并使用capybara-webkit填写,但没有任何运气.

我的模板看起来像这样

<%= simple_form_for form, url: url, method: :put do |f| %>
  <%= f.input :notes, as: :text %>
  <%= f.button :submit, class: 'fluid' %>
<% end %>

<!-- https://github.com/lepture/editor -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/editor/0.1.0/editor.css">
<script src="//cdn.jsdelivr.net/editor/0.1.0/editor.js"></script>
<script src="//cdn.jsdelivr.net/editor/0.1.0/marked.js"></script>

<script !src="">
  (function () {
    var editor = new Editor();
    editor.render();
  })()
</script>
Run Code Online (Sandbox Code Playgroud)

渲染的html(包括执行的编辑器javascript)看起来像这样(通过capybara-webkit调试工具)

<form novalidate="novalidate" class="simple_form simple_form ui form segment new_steps_update" id="new_steps_update" action="/presentations/1/who" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="?"><input type="hidden" name="_method" value="put">
  <div class="field text optional steps_update_notes"><label class="text optional" for="steps_update_notes">Notes</label><textarea class="text …
Run Code Online (Sandbox Code Playgroud)

editor capybara capybara-webkit

6
推荐指数
1
解决办法
1149
查看次数

很奇怪&nbsp; 无缘无故地出现

我刚刚推出了我的新网站,并且在多个浏览器中查看它是如何执行的,我注意到了一些奇怪的东西.



你能看到"但是"这个词之后的差距吗?根据我的推理,下面一行的"是"一词应该在它旁边,因为它有足够的空间 - 但正如你所看到的,它不是.

虽然这个截图来自Firefox(10),但我在Chrome(17)和Internet Explorer(9)中得到了同样的东西.

使用Firebug来检查元素,它显示&nbsp;在'was'和'disappointed'之间(这可以解释为什么它不在上面的那一行) - 但是在查看源时,没有这样的&nbsp;存在.

这导致我建议浏览器插入它们 - 但我不知道为什么.

无论如何,有问题的页面是http://limeblast.co.uk/2012/02/currently-playing/

html-entities

5
推荐指数
1
解决办法
3310
查看次数

来自 Stimulus 控制器的 Rails URL 助手?

简单的问题,从刺激控制器内部访问 URL 助手的正确方法是什么?

现在我们必须做一些相当难闻的代码,其中控制器通过 erb 传递,以允许这样的事情:

// app/javascript/controllers/stage_filter_controller.js.erb

import { Controller } from 'stimulus'

export default class StageFilterController extends Controller {

  // snip...

  getPlotsUrl(siteId) {
    var url = '<%= Rails.application.routes.url_helpers.plot_options_path %>'
    url += `?site=${siteId}`
    return url;
  }
}

Run Code Online (Sandbox Code Playgroud)

我一点也不喜欢这个,但不知道如何以其他方式做到这一点。

ruby-on-rails stimulusjs

3
推荐指数
1
解决办法
2834
查看次数

`block in activate_dependencies':不能满足'windows-pr(= 1.2.1)',已经激活'windows-pr-1.2.2'(Gem :: LoadError)

我正在尝试使用http://rove.io/在我的Windows 8机器上设置一个流浪盒.我按照网站上的说明(特别是安装gem install librarian-chef和运行librarian-chef install,但我收到以下错误:

C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:774:in `block in activate_dependencies': can't satisfy 'windows-pr (= 1.2.1)', already activated 'windows-pr-1.2.2' (Gem::LoadError)
    from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `each'
    from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
    from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:750:in `activate'
    from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:780:in `block in activate_dependencies'
    from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `each'
    from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
    from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:750:in `activate'
    from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb:1232:in `gem'
    from C:/Ruby193/bin/librarian-chef:22:in `<main>'
Run Code Online (Sandbox Code Playgroud)

ruby gem vagrant

2
推荐指数
1
解决办法
848
查看次数