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 } endendhello = 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.rbchecking for rb_thread_blocking_region()... yeschecking for rb_wait_for_single_fd()... yeschecking for rb_hash_dup()... yeschecking for rb_intern3()... yes*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers. Check the mkmf.log file for moredetails. 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}/libextconf.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=rubyERROR: Error installing rails: The 'atomic' native gem requires installed build tools.Please update your PATH to include build tools or download the DevKitfrom '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 ...
随机推荐
- bzoj 3174: [Tjoi2013]拯救小矮人
Description 一群小矮人掉进了一个很深的陷阱里,由于太矮爬不上来,于是他们决定搭一个人梯.即:一个小矮人站在另一小矮人的 肩膀上,知道最顶端的小矮人伸直胳膊可以碰到陷阱口.对于每一个小矮人, ...
- 51Nod 1196 字符串的数量
用N个不同的字符(编号1 - N),组成一个字符串,有如下要求: (1) 对于编号为i的字符,如果2 * i > n,则该字符可以作为结尾字符.如果不作为结尾字符而是中间的字符,则该字符后面可以 ...
- hdu3183 RMQ
A Magic Lamp Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tot ...
- bzoj 1217: [HNOI2003]消防局的设立
Description 2020年,人类在火星上建立了一个庞大的基地群,总共有n个基地.起初为了节约材料,人类只修建了n-1条道路来连接这些基地,并且每两个基地都能够通过道路到达,所以所有的基地形成了 ...
- Thread类中的静态方法
1.currentThread() currentThread()方法返回的是对当前正在执行线程对象的引用. package thread; /** * 线程类的构造方法.静态块是被main线程调用的 ...
- public、protected、default、private区别
public.protected.default.private: 修饰符 本类 同包 子类 其他 public √ √ √ √ protected √ √ √ × default √ √ × × p ...
- 文件上传,服务端压缩文件方法,重点是png与gif图片的压缩,保证了透明度与动画
/// <summary> /// 上传文件帮助类 /// </summary> public class ImageUploadHelper { #region SaveVi ...
- 小程序上拉下拉共存时不可使用scroll-view的解决方法
使用 bindscrolltolower ,必须搭配使用的 scroll-view 会导致小程序 "enablePullDownRefresh": true 下拉不能使用. 解决方 ...
- MySQL/MariaDB 在插入数据的时候提示 Incorrect string value
现象 今天开新工程,建表的时候弹出这玩意: what's this? 看起来好像是说我传入的内容不对? 可是仔细看看内容,没乱码,标准的中文字符串.想来是编码问题. 经过修改编码后,解决了问题. 解决 ...
- React 系列教程 1:实现 Animate.css 官网效果
前言 这是 React 系列教程的第一篇,我们将用 React 实现 Animate.css 官网的效果.对于 Animate.css 官网效果是一个非常简单的例子,原代码使用 jQuery 编写,就 ...