小编use*_*621的帖子

Git - 致命:无法创建'/path/my_project/.git/index.lock':文件存在

当我尝试将项目树移动到git repo时,我仍然收到此错误消息.

我用这个项目检查了我的目录的权限,这些是在777上设置的.在my_project我设置的目录中的终端:

git init

如果我试试

git add.

要么

git commit -m"首次上传"

所以我会得到错误

fatal: Unable to create '/path/my_proj/.git/index.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
Run Code Online (Sandbox Code Playgroud)

我也尝试创建一个新的repo并在那里提交它,但遗憾的是仍然是同样的错误信息......我已经有点绝望了,我试着找到整个下午的解决方案,但仍然没有成功...

请问有谁帮助我,问题的原因是什么?

百万次谢谢!

git

755
推荐指数
17
解决办法
48万
查看次数

如何设置<td>的固定宽度?

简单方案:

  <tr class="something">
    <td>A</td>
    <td>B</td>
    <td>C</td>
    <td>D</td>
  </tr>
Run Code Online (Sandbox Code Playgroud)

我需要设置一个固定的宽度<td>.我试过了:

tr.something {
  td {
    width: 90px;
  }
}
Run Code Online (Sandbox Code Playgroud)

td.something {
  width: 90px;
}
Run Code Online (Sandbox Code Playgroud)

对于

<td class="something">B</td>
Run Code Online (Sandbox Code Playgroud)

乃至

<td style="width: 90px;">B</td>
Run Code Online (Sandbox Code Playgroud)

但宽度<td>仍然相同.

css html-table width twitter-bootstrap

472
推荐指数
11
解决办法
81万
查看次数

Google OAuth 2授权 - 错误:redirect_uri_mismatch

在网站https://code.google.com/apis/console上我已经注册了我的应用程序,为我的应用设置了生成的客户端ID:客户端密钥,并尝试使用Google登录.不幸的是,我收到了错误消息:

Error: redirect_uri_mismatch
The redirect URI in the request: http://127.0.0.1:3000/auth/google_oauth2/callback did not match a registered redirect URI

scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
response_type=code
redirect_uri=http://127.0.0.1:3000/auth/google_oauth2/callback
access_type=offline
approval_prompt=force
client_id=generated_id
Run Code Online (Sandbox Code Playgroud)

这条消息是什么意思,我该如何解决?我使用gem omn​​iauth-google-oauth2.

authentication oauth-2.0 google-signin

362
推荐指数
21
解决办法
48万
查看次数

BitBucket - 以ZIP格式下载源代码

我知道我可以通过git clone命令获得项目,但有什么办法,如何从BitBucket.org通过Web界面下载项目?在最好的方式,我正在寻找一种方法来下载项目源作为ZIP压缩文件.

git zip download bitbucket git-clone

267
推荐指数
6
解决办法
22万
查看次数

Rails 3 - 无法安装pg gem

当我尝试运行bundle(bundle install)时,我总是得到

Installing pg (0.13.2) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include …
Run Code Online (Sandbox Code Playgroud)

macos ruby-on-rails libpq pg postgresql-9.1

96
推荐指数
7
解决办法
8万
查看次数

如何在CSS中对图像进行叠加?

我想要实现这样的事情:

这个效果

当我将鼠标悬停在图像上时,我想在图像上添加一些带有文字和图标的深色图像.

我被困在这里.我找到了一些教程,但他们没有解决这个问题.另外,另一个问题 - 每个图像都有不同的高度.宽度始终相同.

如何实现这种效果?

html css image hover opacity

54
推荐指数
4
解决办法
18万
查看次数

在MySQL中删除数据库返回"错误丢弃数据库错误:66"

考虑:

DROP DATABASE db_name;
ERROR 1010 (HY000): Error dropping database (can't rmdir './db_name', errno: 66)
Run Code Online (Sandbox Code Playgroud)

问题是我不知道文件/目录的位置 - / usr/local/mysql/bin /中缺少此文件...

我该如何解决这个问题?

mysql root drop-database osx-lion

42
推荐指数
2
解决办法
4万
查看次数

Rails和OS X:如何安装rmagick?

我已经完全绝望了 - 我花了一整天的时间尝试将rmagickgem 安装到Mac OS X Lion,但实际上这是一个悲剧.我在Google上看到了很多类似的主题,但没有任何帮助我.

我想完全卸载imagemagick通过brew并重新安装(这是运作良好),然后安装rmagick,但每次当我尝试安装这种宝石的时候,我收到此错误:

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

        /Users/adam/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
checking for clang... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... yes …
Run Code Online (Sandbox Code Playgroud)

ruby homebrew ruby-on-rails rmagick osx-lion

34
推荐指数
7
解决办法
3万
查看次数

PostgreSQL - GROUP BY子句或用于聚合函数

我在SO上找到了一些主题,但我仍然无法找到正确的查询设置.

这是查询,在localhost上很有用:

@cars = Car.find_by_sql('SELECT cars.*, COUNT(cars.id) AS counter 
                         FROM cars 
                         LEFT JOIN users ON cars.id=users.car_id 
                         GROUP BY cars.id ORDER BY counter DESC')
Run Code Online (Sandbox Code Playgroud)

但是在Heroku上给出了上面的错误 - GROUP BY子句或者在聚合函数中使用.

然后我在某处读过,我应该指定表中的所有列,所以我尝试了这个:

@cars = Car.find_by_sql('SELECT cars.id, cars.name, cars.created_at, 
                                cars.updated_at, COUNT(cars.id) AS counter 
                         FROM cars 
                         LEFT JOIN users ON cars.id=users.car_id 
                         GROUP BY (cars.id, cars.name, cars.created_at, cars.updated_at) 
                         ORDER BY counter DESC')
Run Code Online (Sandbox Code Playgroud)

但这不适用于localhost,也不适用于Heroku ......

什么应该是正确的查询配置?

sql postgresql heroku ruby-on-rails-3

29
推荐指数
3
解决办法
7万
查看次数

HAML - 带破折号的参数

我怎样才能转换这一行

  <body data-spy="abcd">
Run Code Online (Sandbox Code Playgroud)

到HAML语法?

这个给我一个错误

  %body{:data-spy => "abcd"}
Run Code Online (Sandbox Code Playgroud)

html haml

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