Ruby 2.1.0 for use with Rails....We stopped supporting Ruby 1.8.x after Rails 3.2. Ruby 1.9.2+ will be supported until Rails 5....假设是mac os brew install sqlite3 其它能够看情况安装,如openSUSE sudo zypper install sqlite3 Rails 4 Hello,World...能够直接用rails生成 $rails new hello 于是就有了 create create README.rdoc create Rakefile create config.ru...welcome index 就会创建以下这些文件(Ruby On Rails 4 hello world,Ruby On Rails上手) create app/controllers/welcome_controller.rb
Fetching gem metadata from https://gems.ruby-china.org/..............Fetching version metadata from https://gems.ruby-china.org/......1.0.3 Using rails-dom-testing 1.0.7 Using activejob 4.2.6 Using activerecord 4.2.6 Using actionview...Installing coffee-rails 4.1.1 Installing jquery-rails 4.1.1 Using rails 4.2.6 Installing sass-rails...Post-install message from rdoc: Depending on your version of ruby, you may need to install ruby rdoc/
的一层包装,它需要 JS的运行环境或者JS的解释器 Uglifier minifies JavaScript files by wrapping UglifyJS to be accessible in Ruby...[root@h202 blog]# 再次尝试 启动服务 [root@h202 blog]# rails server => Booting WEBrick => Rails 4.2.6 application...starting in development on http://localhost:3000 => Run `rails server -h` for more startup options =...> Ctrl-C to shutdown server [2016-04-22 13:28:17] INFO WEBrick 1.3.1 [2016-04-22 13:28:17] INFO ruby
. ---- Rails 的目录结构 [root@h202 blog]# tree . ├── app │ ├── assets │ │ ├── images │ │ ├── javascripts...└── views │ └── layouts │ └── application.html.erb ├── bin │ ├── bundle │ ├── rails
安装Rails 检查环境 检查以下三个软件,确保已经安装 [root@h202 ruby]# ruby -v ruby 2.3.0p0 (2015-12-25 revision 53290) [x86...https://gems.ruby-china.org/ [root@h202 ruby]# ---- 安装 Rails [root@h202 ruby]# gem install rails Fetching...-4.2.6 Installing ri documentation for rails-4.2.6 Done installing documentation for rack, concurrent-ruby..., mime-types, mail, actionmailer, rails after 613 seconds 32 gems installed [root@h202 ruby]# echo $?...0 [root@h202 ruby]# rails --version Rails 4.2.6 [root@h202 ruby]#
RVM RVM (Ruby Version Manager) 是一个 CLI 工具,可以用来对 ruby 的多个版本进行安装,隔离和管理 RVM is a command-line tool which...allows you to easily install, manage, and work with multiple ruby environments from interpreters to...sets of gems 是玩 ruby 不可多得的好工具 ---- 安装RVM [root@h202 ruby]# gpg --keyserver hkp://keys.gnupg.net --recv-keys...0 [root@h202 ruby]# curl -sSL https://get.rvm.io | bash -s stable Downloading https://github.com/rvm/...0 [root@h202 ruby]#
查看可用ruby版本 [root@h202 ruby]# rvm list known -bash: rvm: command not found [root@h202 ruby]# su - root...[root@h202 ~]# cd ruby/ [root@h202 ruby]# rvm list known # MRI Rubies [ruby-]1.8.6[-p420] [ruby-]1.8.7...[-head] # security released on head [ruby-]1.9.1[-p431] [ruby-]1.9.2[-p330] [ruby-]1.9.3[-p551] [ruby...-]2.0.0[-p648] [ruby-]2.1[.8] [ruby-]2.2[.4] [ruby-]2.3[.0] [ruby-]2.2-head ruby-head # for forks use...[root@h202 ruby]# ---- 安装ruby 接上版本号就可以自动安装指定版本的ruby [root@h202 ruby]# rvm install 2.3 Searching for binary
前言 Rails 是使用 Ruby 语言编写的网页程序开发框架 通过为开发者提供常用组件,来简化网页程序的开发 Tip: 类似于 python 的 Django ,perl 的 Dancer Rails...our code is more maintainable, more extensible, and less buggy 约定优于配置 Convention Over Configuration: Rails...不要把有限的生命浪费在人家已经反复踩过的坑里 配置如果不在代码内部消化,必然要在外面申明,而配置复杂到一定程度后,本身就已经成为了一门具备独立语法的体系,逻辑不在代码里就在配置里,逻辑是守恒的 这里分享一下 Rails...的相关基础,详细可以参考 官方文档 和 Ruby China 的 Rails 入门 Tip: 当前的最新版本为 Rails 5.0.0.beta3 发布于 February 27, 2016 4:00
bin/ 存放运行程序的 rails 脚本,以及其他用来部署或运行程序的脚本。 config/ 设置程序的路由,数据库等。详情参阅 “设置 Rails 程序” 一文。...任务在 Rails 的各组件中定义。如果想添加自己的任务,不要修改这个文件,把任务保存在 lib/tasks 文件夹中。 README.rdoc 程序的简单说明。...详情参阅 “测试 Rails 程序” 一文。 tmp/ 临时文件,例如缓存,PID,会话文件。 vendor/ 存放第三方代码。经常用来放第三方 gem。
409B6B1796C275462A1703113804BB82D39DC0E3 curl -sSL https://get.rvm.io | bash -s stable rvm list known rvm list rvm install 2.3 ruby...-v gem -v sqlite3 --version gem source -l time gem sources --add https://gems.ruby-china.org/ --remove...https://rubygems.org/ gem install rails rails --version gem list rails new blog cd blog/ head -n 3 Gemfile...vim Gemfile gem install rake -v '11.1.2' bundle install tree rails server gem install uglifier bundle...exec spring binstub --all bundle list | grep uglifier yum install nodejs rails server -b 0.0.0.0 netstat
可以进行访问 (无法从外部访问,原因是并未绑定IP) 直接使用 Ctrl + C 就可以停止此应用 如果希望从外部访问,可以进行如下配置 -b 可以绑定服务 IP [root@h202 blog]# rails...server -b 0.0.0.0 => Booting WEBrick => Rails 4.2.6 application starting in development on http://0.0.0.0...:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2016-04-22 13:47...:39] INFO WEBrick 1.3.1 [2016-04-22 13:47:39] INFO ruby 2.3.0 (2015-12-25) [x86_64-linux] [2016-04-
其实就是一捆gems Tip: 查看本地有哪些 gem ,可以通过如下方式 [root@h202 ruby]# gem list *** LOCAL GEMS *** actionmailer (4.2.6...actionview (4.2.6) activejob (4.2.6) ... ... rdoc (4.2.1) rvm (1.11.3.9) sprockets (3.6.0) sprockets-rails...Rails 程序 我们创建一个叫 blog 的项目 [root@h202 ruby]# rails new blog create create README.rdoc...create app/models/concerns/.keep create bin create bin/bundle create bin/rails...0 [root@h202 ruby]# ls blog [root@h202 ruby]#
安装 gem install rails 如果安装过程中出错,可能是ruby版本太低了,先升级ruby //通过brew进行安装升级ruby brew update brew install ruby...switch /Applications/Xcode.app/ 安装sqllit3 如果需要 gem install sqlite3-ruby 继续之前的操作 rails new blog cd blog...bundle install rails server 打开http://0.0.0.0:3000/ 出现页面 说明安装成功。...如果报错 Your Ruby version is 2.3.3, but your Gemfile specified 2.5.1 使用rvm来管理ruby版本,曾经尝试过rbenv 失败了, rvm安装文档...https://blog.csdn.net/napoay/article/details/50510930 切换rvm当前版本到ruby-2.5.1 创建controller文件 bin/rails generate
Welcome 作为测试的第一篇博客,惯例Hello World,顺便熟悉一下markdown语法。...#include using namespace std; int main(){ couthello world"; return 0; } st=>start: 开始
public ConfigurableApplicationContext run(String... args) { // 1 创建并...
可移植的C/C++IDE C-Free Light Table Visual Studio系列 第一个c语言程序: #include int main(void) { printf("Hello..., World! ..., world!"...World"); } } python python Python是一种计算机程序设计语言。...编译器: pycharm 第一个python程序: print "Hello, World!"
Welcome to Hexo! This is your very first post. Check documentation for more info...
欢迎您 ! 主人不在随便坐哈 ~ Welcome to Hexo! This is your very first post. Check document...
领取专属 10元无门槛券
手把手带您无忧上云