Ruby on Rails错误总结

具体的搭建过程详见这个链接:

http://railstutorial-china.org/chapter1.html



下面是我在使用的时候出现的错误以及解决方案:

错误:

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/mysql2-0.3.14 for inspection.

Results logged to /usr/local/rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/extensions/x86_64-linux/2.0.0/mysql2-0.3.14/gem_make.out

An error occurred while installing mysql2 (0.3.14), and Bundler cannot continue.

Make sure that `gem install mysql2 -v '0.3.14'` succeeds before bundling.


解决:

yum install mysql-devel


错误:

执行rails server 出现in `autodetect': Could not find a JavaScript runtime.

执行rails server

in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)


解决:

GemFile(文件的位置在项目的首页中) 文件的末尾加上

gem 'execjs' 

gem 'therubyracer'

之后执行

bundle install



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值