启动rails服务器出错
终端输入框rails之后出现
Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
说是没有安装sqlite3
gem install sqlite3
又说安装失败,按提示查了一下日志gem_make.out,可能是没有安装sqlite-devle
yum install sqlite-devel
然后gem install sqlite3成功
好吧,现在rails server 出错,但是屏幕 上显示不完整全部的内容,查了一下gg,用script可以将终端所有的内容输入在一个文本文件夹中
查看这个文件夹发现以下错误
Could not find a JavaScript runtime
好吧,按r o r圣经上所说的
編輯Gemfile這個檔案加上一行gem 'therubyracer',輸入bundle install
然后再启动服务,
ok
开放rials 服务3000端口
编辑防火墙配置文件
vim /etc/sysconfig/iptables
在上面添加一行
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8000 -j ACCEPT
保存退出
重启防火墙
service iptables restart
浙公网安备 33010602011771号