
- 发布时间
- 1995年12月
- 音标(美)
- [ˈrubi]
- 最新版本
- 2.6.3-preview1
- 适用平台
- 跨平台
- 类 别
- 脚本语言
- 词条名
- Ruby
- 中文名
- Ruby
- 创始人
- 松本行弘
- 外文名
- Ruby
-
ruby
2016-07-15 13:55:07ruby Ruby 一般是从命令行运行,方式如下: $ ruby [ options ] [.] [ programfile ] [ arguments ... ] ruby -e prog 命令: -e prog 指定 prog 作为程序在命令行中执行。可以指定...ruby
Ruby 一般是从命令行运行,方式如下:
$ ruby [ options ] [.] [ programfile ] [ arguments ... ]
ruby -e prog 命令:
-e prog 指定 prog 作为程序在命令行中执行。可以指定多个 -e 选项,用来执行多个程序。 -
Ruby
2012-06-16 09:43:31Ruby Ruby,一种为简单快捷的面向对象编程(面向对象程序设计)而创的脚本语言,在20世纪90年代由日本人松本行弘(まつもとゆきひろ/Yukihiro Matsumoto)开发,遵守GPL协议和Ruby License。它的灵感与特性...Ruby
Ruby,一种为简单快捷的面向对象编程(面向对象程序设计)而创的脚本语言,在20世纪90年代由日本人松本行弘(まつもとゆきひろ/Yukihiro Matsumoto)开发,遵守GPL协议和Ruby License。它的灵感与特性来自于 Perl、Smalltalk、Eiffel、Ada 以及 Lisp 语言。由 Ruby 语言本身还发展出了JRuby(Java 平台)、IronRuby(.NET 平台)等其他平台的 Ruby 语言替代品。Ruby的作者于1993年2月24日开始编写Ruby,直至1995年12月才正式公开发布于fj(新闻组)。因为Perl发音与6月诞生石pearl(珍珠)相同,因此Ruby以7月诞生石ruby(红宝石)命名。
历史
Ruby明显比其他类似的编程语言(如Perl或Python)年轻,又因为Ruby是日本人发明的,所以早期的非日文资料和程序都比较贫乏,所以现在在网上仍然可以找到Ruby的资料太少之类的批评。约于2000年,Ruby开始进入美国,英文的资料开始发展。 2011年10月31日1.9.3的第一个稳定版本1.9.3p0发布。 2012年2月16日发布了1.9.3-p125. -
ruby与ruby on rails环境部署
2020-02-12 11:12:21Ruby 官网:http://www.ruby-lang.org/en/downloads/ 具体地址:https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.gz RubyGems 官网:https://rubygems.org/pages/download 具体地址:https://ru...环境:centos7 Mini安装
下载软件包
Ruby
官网:http://www.ruby-lang.org/en/downloads/
具体地址:https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.gz
RubyGems
官网:https://rubygems.org/pages/download
具体地址:https://rubygems.org/rubygems/rubygems-3.1.2.tgz
Sqlite3
官网:https://www.sqlite.org/download.html
具体地址:https://www.sqlite.org/2020/sqlite-autoconf-3310100.tar.gz
Openssl
官网:https://www.openssl.org/source/
具体地址:https://www.openssl.org/source/openssl-1.1.1d.tar.gz# cd /software # wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.gz # wget https://rubygems.org/rubygems/rubygems-3.1.2.tgz # wget https://www.sqlite.org/2020/sqlite-autoconf-3310100.tar.gz # wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
0.安装nodejs
# curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash # yum -y install nodejs # node -v
1.安装Openssl
# cd /software # tar xvf openssl-1.1.1d.tar.gz # cd openssl-1.1.1d # ./config -fPIC --prefix=/usr/local/openssl enable-shared # ./config -t # make && make install
2.安装Sqlite3
# cd /software/ # tar xvzf sqlite-autoconf-3310100.tar.gz # cd sqlite-autoconf-3310100 # ./configure --prefix=/usr/local # make && make install
3.安装Ruby
# cd /software # tar xvf ruby-2.7.0.tar.gz # cd ruby-2.7.0 # ./configure # make # make install [ 若 /software/ruby-2.7.0/lib/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- openssl (LoadError) 则 # cd /software/ruby-2.7.0/ext/openssl # ruby extconf.rb --with-openssl-include=/usr/local/openssl/include/ --with-openssl-lib=/usr/local/openssl/lib # make # make install 再回到上面 # cd /software/ruby-2.7.0 # make install ] # ruby -v ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
4.安装RubyGems
# cd /software # tar zxvf rubygems-3.1.2.tgz # cd rubygems-3.1.2 # ruby setup.rb [ 若 /software/rubygems-3.1.2/lib/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- zlib (LoadError) 则 # yum -y install zlib-devel 然后 # cd /software/ruby-2.7.0/ext/zlib/ # ruby extconf.rb # make # make install 再回到上面 # cd /software/rubygems-3.1.2 # ruby setup.rb ] # gem -v 3.1.2
5.安装Rails
查看gem源 # gem source -l 删除所有的gem源 # gem source -r 上面查到的Url 添加一个gem源 # gem source -a http://gems.ruby-china.com/ 刷新source的cache # gem source -u # gem install rails # rails -v
6.新建一个项目
先准备一个项目目录,自己解决 # rails new ./hello 提示黄字Don't run Bundler as root.....等等时 Ctrl+C手动终止,其实hello已经建立 # cd hello # vi Gemfile 把第一行的source源url换成 http://gems.ruby-china.com/ 保存,再执行 # bundle # curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo # yum install -y yarn # rails webpacker:install # rails s 若如下 => Booting Puma => Rails 6.0.2.1 application starting in development => Run `rails server --help` for more startup options /usr/local/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/stack.rb:37: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /usr/local/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/static.rb:110: warning: The called method `initialize' is defined here Puma starting in single mode... * Version 4.3.1 (ruby 2.7.0-p0), codename: Mysterious Traveller * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://127.0.0.1:3000 * Listening on tcp://[::1]:3000 Use Ctrl-C to stop 则成功
6.配置
查看ruby on rails的web服务帮助 rails server -h Usage: rails server -u [thin/puma/webrick] [options] Options: -e, [--environment=ENVIRONMENT] # Specifies the environment to run this server under (test/development/production).特指一个环境变量文件 -p, [--port=port] # Runs Rails on the specified port - defaults to 3000.特指一个端口号 -b, [--binding=IP] # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'.绑定一个特殊的IP -c, [--config=file] # Uses a custom rackup configuration. # Default: config.ru 调用一个配置文件与默认 -d, [--daemon], [--no-daemon] # Runs server as a Daemon. 后台运行 -u, [--using=name] # Specifies the Rack server used to run the application (thin/puma/webrick). -P, [--pid=PID] # Specifies the PID file. # Default: tmp/pids/server.pid -C, [--dev-caching], [--no-dev-caching] # Specifies whether to perform caching in development. [--early-hints], [--no-early-hints] # Enables HTTP/2 early hints. [--log-to-stdout], [--no-log-to-stdout] # Whether to log to stdout. Enabled by default in development when not daemonized. 结论: # rails server -b 0.0.0.0 -p 3001 -d 指明特定的IP 和端口 后台运行
7.安装mysql
# yum install mysql-devel # vi Gemfile gem 'mysql2', '~> 0.3.0' # bundle
-
ruby安装
2018-08-07 23:28:50环境ubuntu16.04 下载 cd /app wget ...tar -zxvf ruby-2.3.1.tar.gz 编译安装 cd ruby-2.3.1/ ./configure -prefix=/app/ruby make make install 检...环境ubuntu16.04
下载
cd /app
wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz
解压
tar -zxvf ruby-2.3.1.tar.gz
编译安装
cd ruby-2.3.1/
./configure -prefix=/app/ruby
make
make install
检测是否安装成功
ruby -v
-
Ruby on Rails入门
2018-12-04 11:14:28Ruby 是最优雅的开发语言,Rails是Web开发最快的框架。Ruby on Rails是目前美国创业公司最喜欢用的技术,开发效率基本上是传统Web开发框架的3-5倍。 本视频介绍了Ruby on Rails的快速入门的路径, 可以让新手快速... -
更新Ruby
2018-08-03 08:01:59更新Ruby _** 更换源(因为Ruby的软件源rubygems.org被屏蔽了,国内那无形之墙,我们需要来修改更换源,把源切换至ruby-china;网上大多数是使用的https://ruby.taobao.org的,这里不再建议使用的了,这是因为... -
Ruby安装
2018-10-25 16:16:29sass是基于ruby的环境,所以安装sass之前需要安装ruby。rudy windows 的安装包官方下载地址是: https://rubyinstaller.org/downloads/ 我目前下载的最新版本为:ruby-2.4.1: 下载好之后,点击安装,建议安装在c... -
ruby入门
2017-05-01 20:03:25Ubuntu 通过 PPA 安装 Ruby 最佳方法是通过 PPA 安装: sudo apt-add-repository ppa:brightbox/ruby-ng sudo apt-get update sudo apt-get install ruby2.2 ruby2.2-dev ruby -v PPA 的优点是... -
Ruby简介
2017-09-09 12:33:11Ruby是一门开源的动态编程语言,注重简洁和效率。Ruby 的句法优雅,读起来自然,写起来舒适。Ruby是一门完全的面向对象的解释型语言,在20世纪90年代由日本人松本行弘(Yukihiro Matsumoto)开发。它的灵感与特性来自... -
Ruby学习记录 - 安装Ruby
2016-09-12 09:49:05一直想学习一下Ruby,要问原因呢..听说学Ruby的妹子很多.. 于是兴致勃勃的去买了一门 研究一下. 首先我们需要下载Ruby,地址 : http://www.ruby-lang.org/en/downloads/ 我下载的版本是: Ruby 2.2.5p319 (2016-04-26... -
ruby面试
2016-10-18 12:15:29ruby面试技巧 常见面试问答及技巧为什么学ruby? (ps: ruby作为一门小众语言,学习ruby要有原因吧 尽量谈谈ruby跟其他语言相比的优点和吸引你的地方. ruby/rails开发过程中遇到问题通常怎么解决? google(vpn), ... -
安装Ruby、多版本Ruby共存、Ruby安装慢问题
2019-05-03 16:31:00rbenv可以管理多个版本的ruby。可以分为3种范围(或者说不同生效作用域)的版本: local版:本地,针对各项目范围 global版:全局,没有shell和local版时使用global版 shell版:当前终端,只针对当前所在终端 查找... -
[3]ruby&ruby on rails入门笔记---用Ruby访问postgresql
2016-11-16 18:51:47在Ruby中,访问数据库可以通过DBI(database API)来访问。Ruby DBI模块为ruby程序访问数据库提供了一个与数据库无关的接口,就像perl的DBI模块一样。其具体的结构:1.The database interface (DBI): 数据库的接口层... -
eclipse的ruby插件安装Ruby(DLTK)
2018-08-09 05:04:10eclipse的ruby插件安装Ruby(DLTK) which ruby 获取到ruby安装的库的路径,在interpreter里面选择填入路径 -
CentOS7搭建ruby环境(RVM安装ruby以及ruby加速)
2019-02-11 22:48:19血淋淋的教训,第二次使用rvm安装ruby(以普通用户运行) [qqq@haproxy ~]$ gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB [qqq@haproxy ~]$ curl -L ... -
Ruby是什么
2019-01-24 10:55:17Ruby是什么 -
Ruby块
2017-07-31 15:31:31Ruby 中大量使用了块(block),block 使得我们的代码更加精简,更加具有维护性。 -
Ruby方法
2017-07-27 17:34:55Ruby 通常用 def 关键字定义方法,在 def 之后是新方法的名称,紧接着是方法体。 -
Ruby安装演示
2018-11-19 21:56:41安装到这个页面时勾选对应的功能: 选项一:把Ruby加到环境变量里,一定要钩上哦,不然还要手动来添加; 选项二:设置.rb和.rbw文件的默认打开程序为Ruby; 选项三:设置Ruby的默认编码为utf-8。 -
[1]ruby&ruby on rails入门笔记---解决Ruby install bundler SSL证书的问题
2016-10-27 00:03:02我们知道,现在淘宝的gem 源已经从 http://ruby.taobao.org/ 换成了https://ruby.taobao.org/. 笔者注,现在好像https://ruby.taobao.org/.另外国内还有另外的一个比较好的ruby gem 源的网站,速度也非常的快 ... -
Ruby语言简介
2019-09-04 16:37:07Ruby是一种解释型、面向对象、动态类型的语言。Ruby采取的策略是在灵活性和运行时安全之间寻找平衡点。随着Rails框架的出现,Ruby也在2006年前后一鸣惊人,同时也指引人们重新找回编程乐趣。尽管从执行速度上说,... -
第一个Ruby程序,Hello Ruby
2017-09-06 23:30:08安装Ruby完成后,环境变量已经自动配置好了,可以直接进入到命令行下检查一下是否正确的安装了,输入ruby -v 如果返回了一串字,只要带着ruby就表示安装成功了,哈哈 ruby 2.4.1p111 (2017-03-22 revision 58053) [x... -
修改ruby镜像
2019-04-10 17:30:46注意:https://gems.ruby-china.com现为ruby官方镜像 https://ruby-china.org/wiki/ruby-mirror gem sources -l gem sources --remove https://ruby.taobao.org/ gem sources -a https://gems.ruby-china.com .....
-
AndroidUSBCamera.zip
-
PHP海报二维码生成插件小程序海报
-
AD7266的Verilog驱动程序.7z
-
云计算基础-Linux系统管理员
-
【存储知识学习】第四章-其中RAID-《大话存储》阅读笔记
-
数据类型转换、运算符、方法入门
-
FFmpeg4.3系列之26:视频监控之H265多路摄像头播控项目实战
-
微信支付2021系列之扫码支付一学就会java版
-
cesium 加载shp原文件
-
【数据分析-随到随学】Hadoop数据分析
-
RabbitMQ消息中间件实战(附讲义和源码)
-
上海名校CS专业第一本科生:我5天里打工3天,丝毫不影响GPA,可见「教学」有多荒谬
-
FFmpeg4.3黄金系列课程:c++版
-
23种JAVA设计模式
-
2021最新Kubernetes(k8s)集群实战精讲
-
Oracle + mybatis
-
模型检测--工具PRISM
-
量化高频交易系统tick数据采集
-
谷歌40人发表59页长文:为何真实场景中ML模型表现不好?
-
C语言编程>第十八周 ④ 下列给定程序中,函数fun的功能是:依次取出字符串中所有字母字符,形成新的字符串,并取代原字符串。