Ruby on Rails,环境安装和Gems

railsinstaller3.2.1 railsinstaller3.2.1版本 立即下载

http://blog.csdn.net/abbuggy/article/details/7400848

如果你的电脑上没有安装Ruby,还等什么,我们去官方网站下载安装程序吧。对于运行Rails3.0,最低需要Ruby1.8.7,现在最新的稳定版应该是1.9.3。在Ruby的官方网站http://www.ruby-lang.org/有为不同操作系统安装Ruby使用的程序连接。如果使用的是windows,直接下载RubyInstaller并像安装普通软件一样安装就可以。我们安装Ruby是为了使用Rails,人家还给咱专门提供了同样基于RubyInstaller的RailsInstaller,能够将一些其他的开发工具一并安装,方便省力。最新版本的RailsInstaller是2.1.0,我们就用这个。这个版本附带有:    

  • Ruby 1.9.3-p125
  • Rails 3.2
  • Bundler 1.0.18
  • Git 1.7.6
  • Sqlite 3.7.3
  • TinyTDS 0.4.5
  • SQL Server support 3.3.3
  • DevKit


安装RailsInstaller时,最好选上“Add executables for Ruby,Git and DevKit to the PATH”,将Ruby,Git,DevKit的bin目录加入PATH环境变量中,方便直接在命令行中使用。当然你也可以不选则这个选项,改为每次执行命令时键入全路径。我没有测试过如果有中文或空格会不会出错,但为了避免不必要的麻烦还是谨慎为好。


如此一来安装工作完毕,测试一下是否工作正常。通过“开始-所有程序-RailsInstaller-Command Prompt with Ruby and Rails”启动命令行工作环境。

查看Ruby版本:

E:\greensoft\RailsInstaller>ruby -v
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
查看Rails版本:

E:\greensoft\RailsInstaller>rails -v
Rails 3.2.1
查看Gems版本:
E:\greensoft\RailsInstaller>gem -v
1.8.19

一切正常!

使用Rails的过程中你经常需要RubyGems(gem)工具来管理以及升级依赖的库(RubyGem)。RubyGem,就是一个个用Ruby语言编写的程序软件包,Rails就是一个最著名的RubyGem。RubyGems是标准的Ruby包管理器,它的功能类似于Linux下的apt-get。

我们来使用gem查看一下RailsInstaller已经安装好的gem包:

E:\greensoft\RailsInstaller>gem list

*** LOCAL GEMS ***

actionmailer (3.2.1)
actionpack (3.2.1)
activemodel (3.2.1)
activerecord (3.2.1)
activerecord-sqlserver-adapter (3.2.1)
activeresource (3.2.1)
activesupport (3.2.1)
arel (3.0.2)
bigdecimal (1.1.0)
builder (3.0.0)
bundler (1.0.22)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.2.0)
erubis (2.7.0)
execjs (1.3.0)
hike (1.2.1)
i18n (0.6.0)
io-console (0.3)
journey (1.0.3, 1.0.2)
jquery-rails (2.0.1)
json (1.6.5, 1.5.4)
mail (2.4.4, 2.4.1)
mime-types (1.18, 1.17.2)
minitest (2.5.1)
multi_json (1.1.0)
mysql2 (0.3.11 x86-mingw32)
pg (0.13.1 x86-mingw32)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2, 1.1)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.1)
railties (3.2.1)
rake (0.9.2.2)
rb-readline (0.4.2)
rdoc (3.12, 3.9.4)
rubygems-update (1.8.19)
rubyzip (0.9.6.1)
sass (3.1.15)
sass-rails (3.2.5)
sprockets (2.1.2)
sqlite3 (1.3.5 x86-mingw32)
sqlite3-ruby (1.3.3)
thor (0.14.6)
tilt (1.3.3)
tiny_tds (0.5.1 x86-mingw32)
treetop (1.4.10)
tzinfo (0.3.32, 0.3.31)
uglifier (1.2.3)

将gem工具升级到最新版本:

E:\greensoft\RailsInstaller>gem update --system
Updating rubygems-update
Fetching: rubygems-update-1.8.21.gem (100%)
Successfully installed rubygems-update-1.8.21
Installing RubyGems 1.8.21
RubyGems 1.8.21 installed

== 1.8.21 / 2012-03-22

* 2 bug fixes:

  * Add workaround for buggy yaml output from 1.9.2
  * Force 1.9.1 to remove it's prelude code. Fixes #305


------------------------------------------------------------------------------

RubyGems installed the following executables:
	E:/greensoft/RailsInstaller/Ruby1.9.3/bin/gem

RubyGems system software updated

使用gem安装gem包:gem会访问internet,获取你希望安装的gem以及这个gem所依赖的其他gems。

E:\greensoft\RailsInstaller>gem install rake
Successfully installed rake-0.9.2.2
1 gem installed
Installing ri documentation for rake-0.9.2.2...
活动代码页: 936
Installing RDoc documentation for rake-0.9.2.2...

有关查看gem工具使用的更多信息:

E:\greensoft\RailsInstaller>gem --help
RubyGems is a sophisticated package manager for Ruby.  This is a
basic help message containing pointers to more information.

  Usage:
    gem -h/--help
    gem -v/--version
    gem command [arguments...] [options...]

  Examples:
    gem install rake
    gem list --local
    gem build package.gemspec
    gem help install

  Further help:
    gem help commands            list all 'gem' commands
    gem help examples            show some examples of usage
    gem help platforms           show information about platforms
    gem help <COMMAND>           show help on COMMAND
                                   (e.g. 'gem help install')
    gem server                   present a web page at
                                 http://localhost:8808/
                                 with info about installed gems
  Further information:
    http://rubygems.rubyforge.org
http://blog.csdn.net/abbuggy/article/details/7400848
步进电机梯形加减速算法的实现 阅读详情

相关推荐

拉曼光谱仪的原理与应用——TFN 7G F660手持式拉曼光谱识别仪

拉曼光谱仪的原理与应用——TFN 7G F660手持式拉曼光谱识别仪

TFN_yzgd的博客 932

笔记---Rails项目的环境部署搭建

本次操作系统为CentOS 7.9,用于新部署一个Rails项目的运行环境,其中包括ruby环境和前端的node环境,使用Nginx作为反向代理服务器,将HTTP请求转发到Rails应用的后端服务器(如Puma或Unicorn)

weixin_47709232的博客 868

Windows 11 24H2 外接显卡坞兼容性实测:3步解决USB设备失效

本文详细解析了Windows 11 24H2系统下外接显卡坞导致USB设备失效的问题,并提供了三步终极解决方案:驱动预解压与手动更新、电源管理设置调整、优化的设备连接顺序。通过雷电3接口的兼容性优化,帮助用户解决键盘鼠标卡死等常见问题,提升外接显卡坞的稳定性与性能。

weixin_31714129的博客 651

解决ruby的 can not find javascript runtime问题

在command prompt with ruby and rails 命令框下进行

cuiliqing1990的专栏 541

使用VNC可视化Docker容器

Docker容器可视化

Robert_Q的博客 1万+

红外图像和可见光图像异源图像配准问题研究

本文旨在研究一种具有高准确率和鲁棒性的融合图像障碍物检测技术,通过把红外和可见光图像进行图像配准和融合,获取高质量的异源融合图像,根据融合图像的特点采用有效的障碍物检测算法,将图像中的障碍物准确检出。......

G_redsky的博客 1万+

如何快速正确的安装 Ruby,&nb…

转自http://ruby-china.org/wiki/install_ruby_guide 首先确定操作系统环境,不建议在 Windows 上面搞,所以你需要用: Mac OS X 任意 Linux 发行版本(Ubuntu,CentOS, Redhat, ArchLinux ...) 强烈新手使用 Ubuntu 省掉不必要的麻烦! 以下代码区域,带有 $ 打头的表示需要在控制台(终端)

u012612302的专栏 554

企业级AI项目落地实战指南

企业级 AI 项目落地需构建“分阶段实施 + 多维度风控”的双轮驱动体系:实施端通过 POC 验证技术可行性、试点建立评估标准、规模化实现价值复制,各阶段需结合行业案例(如东阳光药、旺盈集团)提炼可复用经验;风险端则需覆盖技术(数据安全、模型稳定性)、合规(全球监管动态)、组织(人才与文化)维度,通过工具化框架(AI TRISM)与案例策略(邮储银行可解释性设计、拓斯达培训体系)实现风险可控。最终通过“场景聚焦 - 合规嵌入 - 持续优化”的循环机制,实现 AI 技术从“试点成功”到“全面价值创造”的跨越。

2509_93209761的博客 1441

Ruby On Rails 常用的精品Gem汇总

首先需要注明一点,本文是原创的并不是从其它地方转载。所有的数据是我从 GitHub 和 RubyGems 上码下来的,数据的截取时间就是本文的发布日期。 RubyGems 的下载量可以看到在用这个 gem 的人数,所以数值很大(这里收藏的下载量至少会大于10万级)。而在 GitHub 上的则代表关注这个gem的源码的人数(本文收藏的至少是过 1k以上 Star 的 repository) No...

weixin_34082854的博客 682

华为OD机试 - 仓库查询 - 树状数组(Java 新系统 200分)

华为OD机试 新系统 题库疯狂收录中,刷题。

学Java,找哪吒 173

[QMT量化交易小白入门]-七十三、主力资金动向:板块与个股资金流数据API(量化python代码解析)

本专栏主要是介绍QMT的基础用法,常见函数,写策略的方法,也会分享一些量化交易的思路,大概会写100篇左右。QMT的相关资料较少,在使用过程中不断的摸索,遇到了一些问题,记录下来和大家一起沟通,共同进步。

木头大左的博客 1129

Ruby on Rails,环境安装和Gems(转载)

(这个ruby安装讲的还比较详细) http://blog.csdn.net/abbuggy/article/details/7400848 如果你的电脑上没有安装Ruby,还等什么,我们去官方网站下载安装程序吧。对于运行Rails3.0,最低需要Ruby1.8.7,现在最新的稳定版应该是1.9.3。在Ruby的官方网站http://www.ruby-lang.org/有为不同

学海无涯 苦写博客 1358

嵌入式系统开发笔记112:通过有人云测试MQTT

项目中使用到“有人”公司的WH-LTE-7S0模块,本文讲解通过有人云进行MQTT测试的方法。

snmplink的博客 1009

在Ubuntu 16.04上使用rbenv安装Ruby on Rails的方法

Ruby on Rails 是开发人员创建网站和 Web 应用程序时最受欢迎的应用程序堆栈之一。Ruby 编程语言与 Rails 开发框架相结合,使应用程序开发变得简单。您可以使用命令行工具rbenv轻松安装 Ruby 和 Rails。使用 rbenv 将为您提供一个稳定的环境,用于开发 Ruby on Rails 应用程序,因为它可以让您轻松切换 Ruby 版本,保持整个团队使用相同的版本。该项目存储库位于 [GitHub] (https://github.com/rbenv/rbenv)。

rubys007的博客 2512

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Ruby学习笔记2 : 一个简单的Ruby网站,搭建ruby环境

Ruby学习笔记2 : 一个简单的Ruby网站,搭建ruby环境 Ruby on Rails website 的基础是 请求-返回 循环。 首先是浏览器请求服务器, 第二步,Second, in our Rails application, the route takes the request and finds ...

weixin_30386713的博客 425

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Ruby on Rails Session 1: How to Build a Ruby on Rails on the Ubuntu.

About Ruby on Rails Ruby on Rails is an application stack that provides developers with a framework to quickly create a variety of web applications. Ruby on Rails does take a little while to install ...

weixin_33965305的博客 111

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

linux ruby环境配置文件,在Ubuntu Linux 7.04系统下配置Ruby环境

其实这个环境配置很容易的应该 apt-get就可以得到了,但事实不是的,特别是在安装一切顺利的时候,但当安装到mongrel时出了点问题,系统总是提示没有mkmf.rb 然后抱了一大堆错误,实际上问题是没有apt-get ruby1.8-dev,这个东西折腾了很久。。。所以这边总结下安装的方法吧准备:sudo apt-get install build-essentialsudo apt-get ...

weixin_39894233的博客 152

今日正式安装ruby+rails+nb6

添加源sudo gedit/etc/apt/sources.list 插入:deb [url]http://us.archive.ubuntu.com/ubuntu[/url] dapper universe deb-src [url]http://us.archive.ubuntu.com/ubuntu[/url] dapper univers...

weixin_34268579的博客 131

ruby

[b]ubuntu10.10 install ruby on rails:[/b] sudo apt-get intall ruby1.8-dev sudo apt-get install rubygems1.8 sudo apt-get install mysql-server sudo apt-get install libmysqlclient-dev //gem install ...

iamwuzhibo的专栏 143

Self summary: Ruby(RVM, gem, bundle)

Establishment of the develop environment: https://ruby-china.org/wiki/install_ruby_guide Evolution of bundler:  Now, the install of ruby will include the gem command for get the oth

Steven Li's Zone 1013

建立一个典型的RubyOnRails网站(一)

写在前面:    第一次,写连载啊,希望能对自己和各位看官有点帮助,多了解一点RubyOnRails开发上的情况吧。能够有点帮助,这就是坚持的理由。^_^   生命百科全书:www.eol.org   网站是基于RoR的,内容是做互动的生命百科博物馆,本文主要介绍,如果通过该网站提供的代码,建立起RoR的网站,并且学习,该网站中使用到的一些,RoR最普通的技术。   资源地址如下,

狼群 727

ror

CASTILHOR BLOGHow to install Ruby on Rails on Ubuntu 10.04 Lucid LynxFollow these steps to have a fresh installation of Ruby on Rails in Ubuntu 10.04:sudo suapt-get install build-essentialapt-get inst...

weixin_33700350的博客 115

ror安装

fedora 14 1. 安装Ruby yum install ruby ruby-libs ruby-devel ruby-rdoc ruby-mysql ruby-irb 2. 安装gems yum install rubygems 3. 安装Rails gem install rails --version 2.2.2 版本2.2.2 4.安...

沃尔德的空间 154
上一篇: Ruby on Rails,从这里开始
下一篇: Ruby on Rails,“无法启动此程序,因为计算机中丢失LIBMYSQL.dll”问题解决
边晓宇
博客等级 码龄20年 214粉丝 67原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值