当我尝试提交更改时,我收到此错误:
error: object file .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0 is empty
fatal: loose object 3165329bb680e30595f242b7c4d8406ca63eeab0 (stored in .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0) is corrupt
Run Code Online (Sandbox Code Playgroud)
不知道如何解决这个错误?
编辑
我试过git fsck我有:
error: object file .git/objects/03/dfd60a4809a3ba7023cbf098eb322d08630b71 is empty
fatal: loose object 03dfd60a4809a3ba7023cbf098eb322d08630b71 (stored in .git/objects/03/dfd60a4809a3ba7023cbf098eb322d08630b71) is corrupt
Run Code Online (Sandbox Code Playgroud) 有人可以描述ERB文件中使用的以下字符的用法:
<% %>
<%= %>
<% -%>
<%# %>
Run Code Online (Sandbox Code Playgroud)
每个人的用法是什么?
我在Ubuntu 11.10和RubyMine上运行我的开发
这是我对database.yml的开发设置:RubyMine为我创建的
development:
adapter: postgresql
encoding: unicode
database: mydb_development
pool: 5
username: myuser
password:
Run Code Online (Sandbox Code Playgroud)
当我尝试运行应用程序时,我在下面收到此错误,似乎我还没有创建"项目"用户,但是,我如何创建用户并在postgres中为其授予数据库?如果这是问题,那么,在Ubuntu中为此任务使用的推荐工具是什么?如果这不是问题,那么,请指教.
Exiting
/home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `initialize': FATAL: Peer authentication failed for user "project" (PG::Error)
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `new'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `connect'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:329:in `initialize'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:303:in `new_connection'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:313:in `checkout_new_connection'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `block (2 levels) in checkout'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `loop'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `block in checkout'
from /home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
from /home/sam/.rvm/gems/ruby-1.9.3-p0@project/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in …Run Code Online (Sandbox Code Playgroud) 我想知道将代码从SVN存储库移动到GIT存储库的推荐方法,以便我们转换开发人员团队并开始使用GIT.
我们可以进行转换并在SVN存储库中完成所有提交吗?
此外,我们的团队目前对SVN感到满意,但是,他们不知道GIT中的分支比SVN容易得多,在哪里可以找到一个证明GIT在分支方面具有强大功能的实际例子?
我使用的是simple_form gem,我有一个国家/地区集合,当我选择国家/地区时它工作正常,更新的记录将存储国家/地区ID,但是,当我尝试编辑记录时,默认情况下未选择所选国家/地区编辑表格.
以下是编辑表单中的代码:
= f.input :country_id, :collection => all_countries
Run Code Online (Sandbox Code Playgroud)
simple_form不应该从db查看所选国家/地区吗?
我试图在heroku终端检测我的数据库,如下所示:
myapp@ubuntu:~/RubymineProjects/myapp$ heroku pg:info
The plugin heroku-sql-console has been deprecated. Would you like to remove it? (y/N) n
=== HEROKU_POSTGRESQL_JADE_URL (DATABASE_URL)
Plan: Dev
Status: available
Connections: 1
PG Version: 9.1.6
Created: 2012-10-10 19:59 UTC
Data Size: 9.1 MB
Tables: 32
Rows: 2802/10000 (In compliance)
Fork/Follow: Unsupported
Run Code Online (Sandbox Code Playgroud)
所以,我尝试过:
myapp@ubuntu:~/RubymineProjects/myapp$ heroku pg:psql
The plugin heroku-sql-console has been deprecated. Would you like to remove it? (y/N) n
psql (9.1.7, server 9.1.6)
SSL connection (cipher: **-**-****-**, bits: 256)
Type "help" for help.
Run Code Online (Sandbox Code Playgroud)
我需要列出所有用户记录:
dbfjinfaes61gb=> …Run Code Online (Sandbox Code Playgroud) 在Rails中,我可以运行:
rake db:migrate:status
Run Code Online (Sandbox Code Playgroud)
但是拉拉维尔怎么样?我怎么知道当我这样做时会运行哪些迁移:
php artisan migrate
Run Code Online (Sandbox Code Playgroud)
我在生产服务器上,我需要确保我不会破坏它.
我可以看到Log facade非常有用.在laravel文档中:
记录器提供RFC 5424中定义的八个日志记录级别:紧急,警报,严重,错误,警告,通知,信息和调试.
但是,我如何记录模型的实例?例如:
$user= User::find($user_id);
Run Code Online (Sandbox Code Playgroud)
那么,是否可以记录$user对象?
我已经开始使用Haxe将我的ActionScript 3项目转换为NME,但是,我想知道Neko在Linux世界中是什么?我搜索了它,我发现它是一只动画猫!
有人可以向我解释一下吗?
到目前为止,我只能判断一个属性是否被继承,但我需要知道继承的来源(例如,哪个CSS文件导致最终值?)这可能吗?
有一个方便的工具吗?
编辑
这是我在chrome Computed Style(show inheritance)中得到的内容.请参阅direction属性,没有关于其继承源的信息

git ×2
laravel ×2
postgresql ×2
css ×1
erb ×1
firebug ×1
git-svn ×1
haxe ×1
heroku ×1
laravel-5.1 ×1
laravel-5.2 ×1
neko ×1
ruby ×1
simple-form ×1
svn ×1
templates ×1
ubuntu-11.10 ×1