rails问题集

Rails问题集

这里转载记录我师傅遇到的,但在网络上无法找到解决方法的问题

undefined method `alias_method_chain’ for I18n::Backend::Simple:Class

在将ruby1.8.7p72换成ruby mbari 1.8.7-p72后出现的问题,问题比较隐蔽(2009-09-23)

 

#运行script/console,报以下错误
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/i18n_interpolation_deprecation.rb:23:
NoMethodError: undefined method `alias_method_chain' for I18n::Backend::Simple:Class

经过google,irc后,没有找到解决方法
最接近问题的就是 这篇文章

但并不能解决问题,尝试自己解决

#查看i18n_interpolation_deprecation源码发现根本看不出问题
#只发现加载了active_support中的i18n/backend/simple
#因此怀疑active_support加载过程中已经出错了
irb
> require 'rubygems'
> require 'activesupport'
#报以下错误
# LoadError: libruby.so.1.8: cannot open shared object file: No such file or directory - /usr/local/ruby/lib/ruby/1.8/
x86_64-linux/bigdecimal.so
#果然,ldd一下
ldd /usr/local/ruby/lib/ruby/1.8/x86_64-linux/bigdecimal.so
# linux-vdso.so.1 =>  (0x00007fff647fe000)
# libruby.so.1.8 => not found
# libdl.so.2 => /lib/libdl.so.2 (0x00007f415c1d0000)
# libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f415bf97000)
# libm.so.6 => /lib/libm.so.6 (0x00007f415bd16000)
# libc.so.6 => /lib/libc.so.6 (0x00007f415b9b4000)
# /lib64/ld-linux-x86-64.so.2 (0x00007f415c5e8000)

#找一下有没有这个文件
find / -iname libruby.so.1.8
# /home/saberma/ruby-1.8.7-p72/libruby.so.1.8
# 在ruby的安装源码包中有这个文件,拷贝至加载路径
cp /home/saberma/ruby-1.8.7-p72/libruby.so.1.8 /usr/lib
# 再次运行script/console,一切顺利

 

问题

git svn dcommit
#提示以下错误
#Committing to https://192.168.1.xx/svn/xxx/trunk/1开发库/1.4系统开发 ...
#HTTP Path Not Found: '/svn/zbs/!svn/bc/151/trunk/1' path not found at /usr/bin/git-svn line 450

#google不到原因,也没有解决,后来定位到了重现的方法:
#将一个已经上传到svn服务器的文件改名,上传就会出现上面的错误,比如:
touch foo
git add .
git commit -a -m 'test file'
git svn dcommit
git mv foo foo1
git commit -a -m 'test svn wired problem'
git svn dcommit
#此时就会出现问题了,出现此问题我只能是重新git-svn clone了
#为避免以上问题产生,应将rename操作分解为先拷贝出来,再git rm,然后先提交rm的内容,再add刚才拷贝的新文件
#方法好繁琐,但实在没有其他办法了

#20100419,再次出现以上问题,尝试使用分步上传成功
# 1.恢复被删除的文件
git reset HEAD db/migrate/20100415010835_add_score_to_resource.rb
git checkout db/migrate/20100415010835_add_score_to_resource.rb
# 2.撤消git repository的版本到之前正常的commit
git reset --soft bb066a4283dbbbe278489a091815f887e45037f5
# 3.分步提交
git add spec
git commit -m '测试1'
# 4. 将其他修改的文件存入stash中
git stash
# 5. 提交(正常)
git svn dcommit
# 重复执行3-5步骤,最后再删除之前要删除的文件
git rm db/migrate/20100415010835_add_score_to_resource.rb

 

 

 

 

 


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值