ruby on rails环境搭建

Windows平台

安装RubyStack
BitNami RubyStack 提供了快速简单的 Ruby on Rails 的一键安装包,包括:Ruby, Subversion, MySQL, SQLite, ImageMagick, 和许多 Ruby Gems, 同时提供可选安装 Apache 2.2 具有URL重写和代理支持,支持 Windows, Linux, and OS X
下载地址:https://bitnami.com/stack/ruby/installer

Mac平台

1.安装 RVM

$ curl -L https://get.rvm.io | bash -s

如果已经安装了RVM,运行下一条命令获得稳定版本

$ rvm get stable

运行下列命令检查安装ruby的需求条件

$ rvm requirements

安装以下库:

$ brew install libtool libxslt libksba openssl

For Mac with Homebrew

$ brew install libyaml

告知RVM,OpenSSL的安装位置,安装ruby 2.2.3

$ rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr

安装rubygems ,我的已经装了

$ which gem

升级

gem update --system

安装rails 4.0

$ gem install rails --version 4.0.0 --no-ri --no-rdoc

查看rails版本

$ rails -v
Rails 4.0.0

第一个rails项目

$ rails new hello
cd hello
bundle install
rails server

浏览器访问

http://localhost:3000/

如果bundle install错误,新建项目时跳过bundle

rails new project --skip-bundle

修改Gemfile

source 'https://rubygems.org'

改为

source 'https://ruby.taobao.org'

然后再执行bundle install
这里写图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

esc_ai

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值