ruby on rails 的使用过程中,遇到的错误及解决办法

1、/data/drolay11/lcb_saas/tmp/build-147274463612855/vendor/bundle/ruby/2.1.0/bin/rake: symbol lookup error: /data/drolay11/lcb_saas/tmp/build-147274463612855/vendor/bundle/ruby/2.1.0/gems/mysql2-0.3.17/lib/mysql2/mysql2.so: undefined symbol: mysql_get_client_info

这种问题可能是ruby版本冲突引起的。删除所有的ruby,重新安装。mysql2用0.3.13的。

 

2、.rvm/gems/ruby-2.1.5/bin/bundle:22:in `

': undefined method `activate_bin_path' for Gem:Module (NoMethodError)

gem install rubygems-update
update_rubygems
or

ruby --disable-gems -S update_rubygems

 

3、NoMethodError: undefined method `spec' for nil:NilClass

An error occurred while installing carrierwave (0.11.0), and Bundler cannot continue.

Make sure that `gem install carrierwave -v '0.11.0'` succeeds before bundling.gem 

gem uninstall bundler

gem install bundler  就是安装新版的bundler

 

4、.rvm/wrappers/ruby-2.1.5/rake nginx:clean nginx RELEASE=yes

rake aborted!
LoadError: cannot load such file -- rubygems/builder

gem install passenger --version 4.0.0.rc6

 

 5、%u转化为汉字的问题:

如:迷恋你娘  %u8FF7%u604B%u4F60%u5A18
 

s = "%u8FF7%u604B%u4F60%u5A18"

b = s.split("%u")-[""]
b.map{|t| [t.to_i(16)].pack("U")}.join

 

6、Bundler::GemspecError: Could not read gem at /XXX-1.8.2.gem. It may be corrupted.

删除cache里的文件,重新bundle install

 

7、国际化时如果有目录,配置文件的写法也是用目录形式,比如: admin/user:

转载地址:http://www.cnblogs.com/limx/p/5826649.html

你可能感兴趣的:(ROR)