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 ...
随机推荐
- bzoj1094[ZJOI2007]粒子运动 计算几何
1094: [ZJOI2007]粒子运动 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 658 Solved: 164[Submit][Status ...
- python+eclipse+pydev开发环境搭建
1.安装配置python2.7(右击我的电脑->属性->高级系统设置->环境变量->系统变量列表中找到Path并双击->变量值中添加";C:\Python27; ...
- MYSQL 二进制安装
系统环境:CentOs6.7 i386 Mysql版本:mysql-5.6.36 root登录linux cd pwd #/root/ wget http://mirrors.sohu.com/mys ...
- Java实现word文档在线预览,读取office文件
想要实现word或者其他office文件的在线预览,大部分都是用的两种方式,一种是使用openoffice转换之后再通过其他插件预览,还有一种方式就是通过POI读取内容然后预览. 一.使用openof ...
- Python类的定义
Python笔记--类定义 一.类定义: class <类名>: <语句> 类实例化后,可以使用其属性,实际上,创建一个类之后,可以通过类名访问其属性 如果直接使用类名修改其属 ...
- Struts2 之 modelDriven & prepare 拦截器详解
struts2 ModelDriven & Prepareable 拦截器 前面对于 Struts2 的开发环境的搭建.配置文件以及 Struts2 的值栈都已经进行过叙述了!这次博文我们讲解 ...
- mybatis添加记录时返回主键id
参考:mybatis添加记录时返回主键id 场景 有些时候我们在添加记录成功后希望能直接获取到该记录的主键id值,而不需要再执行一次查询操作.在使用mybatis作为ORM组件时,可以很方便地达到这个 ...
- CSS(一)解析浮动塌陷与清除浮动
清除浮动方法 1.对父级设置适合CSS高度,父级元素撑开并且包含子元素. <p>固定高度</p> <div style="height: 50px;" ...
- Linux——makefile编写
以前对makefile的编写,限于刚开始接触,我都比较局限一些死板的格式,有时候就会显得有些繁琐.在进一步了解一些系统编译和链接的知识后,对makefile编写流程有了一些新的认识,所以来此梳理梳理, ...
- Ubuntu 16.04+.Net Core+Docker+Uginx安装部署
前言 最近公司的项目打算移植到.Net Core平台,所以调研了一下.Net Core在Linux下的安装部署.本篇文章会一步步的描述从安装到配置到部署的全部过程.在文章的结构和内容里,笔者借鉴了很多 ...