Ruby开发入门
开发环境搭建
现在最新版本是4.0.2, 使用这个key仍然有效, 对于这个没什么好说的, 如有必要,请支持购买正版。
No.1:
name: rubymine
License Key:
70414-12042010
00002VG0BeoZbwmNAMNCx5E882rBEM
Ysn1P!e"s830EDlHcWg8gmqYVkvZMo
Injf4yqlO1yy"82NiwNzyYInoT7AiX
No.2:
username:EMBRACE
license key:
89330-12042010
00001p4HOxG8it!A4uOcpk1E"boEjk
v!tn2JZJC8Jw4hVlEmviJ0ge461sTw
owxcaVPQvd1gQzGxOpt2rElKQ3"R7w
1
2
3
4
5
6
7
8
9
10
11
|
class Hello def say str = 'hello world!!!' 5 .times { puts str } end end hello = Hello. new () hello.say |
1
|
gem install rails --version "= 4.0.0" --no-ri --no-rdoc |
1
|
gem install rails-4.0.0.gem --verbose --no-ri --no-rdoc |
1
2
3
4
5
6
7
8
|
#列举所有源 gem sources #添加一个源 gem sources -a "http://ruby.taobao.org" #删除一个源 gem sources -r "https://rubygems.org" |
1
2
3
4
|
http: //rubygems .org/ http: //gems .github.com http: //gems .rubyforge.org http: //ruby .taobao.org |
1
2
|
#更新RubyGem管理器 gem update --system |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. D:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb checking for rb_thread_blocking_region()... yes checking for rb_wait_for_single_fd()... yes checking for rb_hash_dup()... yes checking for rb_intern3()... yes *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=D:/RailsInstaller/Ruby1.9.3/bin/ruby --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib extconf.rb:37:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError ) Gem files will remain installed in D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9 .1/gems/mysql2-0.3.13 for inspection. Results logged to D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0. 3.13/ext/mysql2/gem_make.out |
1
2
3
4
|
gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\Program Files (x86)\MySQL\mysql-connector-c-noinstall-6.0.2-win32\lib" --with-mysql-include="C:\Program Files (x86)\MySQL\mysql-connector-c-noinstall-6.0.2-win32\include" --with-mysql-dir="C:\Program Files (x86)\MySQL\mysql-connector-c-noinstall-6.0.2-win32"' |
3.如果不使用RailsInstaller,那么用gem install时经常会报下面错误:
1
2
3
4
5
6
7
|
D:\Ruby200\bin>gem install rails --platform=ruby ERROR: Error installing rails: The 'atomic' native gem requires installed build tools. Please update your PATH to include build tools or download the DevKit from 'http://rubyinstaller.org/downloads' and follow the instructions |
1
2
3
4
5
6
7
8
|
> cd <DEVKIT_INSTALL_DIR> > ruby dk.rb init #生成config.yml,这里会检查将要添加DevKit支持的Ruby列表,只支持通过RubyInstaller安装的Ruby #如果这里列出的Ruby与你的要求不符,可以手动修改 > ruby dk.rb review #检查要添加DevKit支持的Ruby列表是否有误,可以略过 > ruby dk.rb install [INFO] Updating convenience notice gem override for 'C:/Ruby192' [INFO] Installing 'C:/Ruby192/lib/ruby/site_ruby/devkit.rb' |
Ruby开发入门的更多相关文章
- 《Ruby语言入门教程v1.0》学习笔记-01
<Ruby语言入门教程v1.0> 编著:张开川 邮箱:kaichuan_zhang@126.com 想要学习ruby是因为公司的自动化测试使用到了ruby语言,但是公司关于ruby只给了一 ...
- scala程序开发入门
scala程序开发入门,快速步入scala的门槛: 1.Scala的特性: A.纯粹面向对象(没有基本类型,只有对象类型).Scala的安装与JDK相同,只需要解压之后配置环境变量即可:B.Scala ...
- 安装ruby开发环境
如何快速正确的安装 Ruby, Rails 运行环境 对于新入门的开发者,如何安装 Ruby, Ruby Gems 和 Rails 的运行环境可能会是个问题,本页主要介绍如何用一条靠谱的路子快速安装 ...
- [转帖]H5 手机 App 开发入门:技术篇
H5 手机 App 开发入门:技术篇 http://www.ruanyifeng.com/blog/2019/12/mobile-app-technology-stack.html 阮一峰老师的文 ...
- Ruby小白入门笔记之<个人记录档>
书写缘由 快两年的JAVA开发,因为来到一家新公司,产品需要用Ruby开发,故此才有了这从头开始,一入编程深似海啊...... 因为入门时是JAVA,所以理念跟规范早已形成,故此感觉突然采用Ruby编 ...
- openresty 前端开发入门五之Mysql篇
openresty 前端开发入门五之Mysql篇 这章主要演示怎么通过lua连接mysql,并根据用户输入的name从mysql获取数据,并返回给用户 操作mysql主要用到了lua-resty-my ...
- java WEB开发入门
WEB开发入门 1 进入web JAVASE:标准- standard JAVA桌面程序 GUI SOCKET JAVAEE:企业-浏览器控制 web 2 软件结构 C/S :client ...
- [译]:Xamarin.Android开发入门——Hello,Android Multiscreen深入理解
原文链接:Hello, Android Multiscreen_DeepDive. 译文链接:Xamarin.Android开发入门--Hello,Android Multiscreen深入理解. 本 ...
- [译]:Xamarin.Android开发入门——Hello,Android深入理解
返回索引目录 原文链接:Hello, Android_DeepDive. 译文链接:Xamarin.Android开发入门--Hello,Android深入理解 本部分介绍利用Xamarin开发And ...
随机推荐
- bzoj3622已经没有什么好害怕的了 dp+组合+容斥(?)
3622: 已经没有什么好害怕的了 Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 1033 Solved: 480[Submit][Status][ ...
- Ubuntu 16.04安装JDK/JRE并配置环境变量
作为一个Linux新手,在写这篇文章之前,安装了几次jdk,好多次都是环境变量配置错误,导致无法登录系统.经过几天的研究,今天新装系统,从头来完整配置一遍 系统版本:Ubuntu 16.04 JDK版 ...
- vim的基本介绍
vim四种模式: 1.正常模式(Normal-mode) 当我们打开vim时就会进入到正常模式,这个时候是不能编辑的,一般用于浏览文件,包括复制,删除一些文本操作.我们可以通过键盘的上下左右来进行光标 ...
- MySQL 内连接与外连接
1.内连接 MySQL中,join,cross join,inner join 是等价的. 2.外连接 2.1 左外连接 left join 2.2 右外连接 right join 3.连接条件 使 ...
- mongo数据更新(修改器)
数据更新简单的做法是删除重新插入update()函数语法 db.集合.update(更新条件,新的对象数据(更新操作符),upsert,multi)upsert如果要更新的数据不存在,则增加一条新的内 ...
- Lintcode391 Number of Airplanes in the Sky solution 题解
[题目描述] Given an interval list which are flying and landing time of the flight. How many airplanes ar ...
- 一些重要的计算机网络协议(IP、TCP、UDP、HTTP)
一.计算机网络的发展历程 1.计算机网络发展 与其说计算机改变了世界,倒不如说是计算机网络改变了世界.彼时彼刻,你我都因网络而有了交集,岂非一种缘分? 计算机与网络发展大致经历如下过程:
- Python笔记十一(迭代器)
这里我们要学会Iterable和Iterator. 一类是集合数据类型,如list.tuple.dict.set.str等: 一类是generator,包括生成器和带yield的generator f ...
- Node.js 模块
稳定性: 5 - 锁定 Node 有简单的模块加载系统.在 Node 里,文件和模块是一一对应的.下面例子里,foo.js 加载同一个文件夹里的 circle.js 模块. foo.js 内容: va ...
- Java语言程序设计课程学期总结
2016-2017 第2学期 课程介绍 编程类课程,76学时(44理论+32实验),学期末还有1周的课程设计. 问题与现状 4个班共120人,教师无法逐一检查每个学生的编程实验. 纸质作业质量不高. ...