• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

RubyonRailsTutorial第一章之搭建开发环境

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

云端开发环境,Cloud9(https://ide.c9.io/)。这个开发环境预先安装好了Rails开发所需要的大多数软件,包括Ruby、RubyGems和Git,需要自己安装Rails。

1、安装rails:$gem install rails -v 4.1.6

2、创建项目:$rails _4.1.6_ new hello_app

  hello_app的目录结构如下所示:

各个目录的内容及含义如下:

3、修改Gemfile,然后执行如下语句:

  $bundle install

  Gemfile的文件的内容如下:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3'

# Use SCSS for stylesheets
# gem 'sass-rails', '~> 4.0.3'
gem 'sass-rails', '5.0.0.beta1'
# Use Uglifier as compressor for JavaScript assets
# gem 'uglifier', '>= 1.3.0'
gem 'uglifier', '2.5.3'
# Use CoffeeScript for .js.coffee assets and views
# gem 'coffee-rails', '~> 4.0.0'
gem 'coffee-rails', '4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# gem 'jquery-rails', '4.0.0.beta2'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
# gem 'turbolinks'
gem 'turbolinks', '2.3.0'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.0'
gem 'jbuilder', '2.2.3'
# bundle exec rake doc:rails generates the API under doc/api.
# gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'sdoc', '0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
#gem 'spring',        group: :development

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]
group :development, :test do
    gem 'sqlite3', '1.3.9'
    gem 'byebug', '3.4.0'
    gem 'web-console', '2.0.0.beta3'
    gem 'spring', '1.1.3'
end

group :production do
    gem 'pg', '0.17.1'
    gem 'rails_12factor', '0.0.2'
end

 

4、运行rails server:

  $rails server -b $IP -p $PORT

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python、Lua和Ruby之优劣发布时间:2022-07-13
下一篇:
Ruby 101:重用、隐藏和多态发布时间:2022-07-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap