Ruby notes #1 Environment setup on Win32 platform
2016-04-14 22:55
211 查看
正式学习Ruby on Rails之前,首先在 Windows 7 平台上进行环境搭建。以下会按照搭建顺序进行展开,当然在安装过程中碰到的 issues 也一并附上。需要下载的安装文件如下:
rubyinstaller 1.9.3
DevKit 4.5.2
获取 netbeans 6.9.1 #当然也可以使用其他,注意6.9.1支持Ruby, 后续版本去除了对Ruby的支持
Note:
所涉及的应用或组件都是 32位 , 所下载的文件名中包含平台描述
如果 project 为空(新建),skip #2 Install Devkit 后半部分 & #3 Verification ,可后续执行
rubyinstaller 1.9.3
DevKit 4.5.2
获取 netbeans 6.9.1 #当然也可以使用其他,注意6.9.1支持Ruby, 后续版本去除了对Ruby的支持
Note:
所涉及的应用或组件都是 32位 , 所下载的文件名中包含平台描述
如果 project 为空(新建),skip #2 Install Devkit 后半部分 & #3 Verification ,可后续执行
Ruby on Rails setup
#1 Install Ruby
• Install Ruby, set the options to add the path to env and associate .rb files.#2 Install Devkit
Ruby 开发套件,类似于Java 的 JDKRun the DevKit installer and extract to C:\RubyDevKit # Extract to anywhere you prefer to Open Command Prompt(cmd) chdir C:\RubyDevKit ruby dk.rb init ruby dk.rb install gem install rails --version ‘= 3.2.13’ # skip following steps unless gemfile defined in your project.( you can gem install the packages required in your project later) Open Command Prompt(cmd) cd C:\yourProjectFolder bundle install
#3 Verification
Verify that everything is working fine by doing the followingEdit C:\Ruby193\lib\ruby\1.9.1\webrick\config.rb and set DoNotReverseLookup to true In command prompt, cd to C:\yourProjectFolder rails s Launch browser and open the page http://localhost:3000 You should have the your app working. The webserver may take some time to start, so try again if you get a page not found error. Terminate the webserver by pressing Ctrl-C or closing the command prompt
Install IDE NetBean
Note that newer versions (7.x and above) do not support Ruby by default. So use 6.9.1 only.Download NetBeans from https://netbeans.org/downloads/6.9.1/index.html. Click on the download button in the Ruby column. Install NetBeans. Use default options and you may skip the installation of GlassFish web server since we will use WebBrick. Launch NetBeans Navigate to File->Open Project. Browse and select C:\yourProjectFolder and click ok ‘Open Project. Click Run->Run Project to start the web server The application can be accessed at http://localhost:3000[/code]Troubleshooting
gem install 时常中断
Description:ERROR: While executing gem ... (Zlib::GzipFile::Error) unexpected end of file
Reason:国内的Great Firewall,你懂的!
Solution:尝试更换 gem sources。如:https://ruby.taobao.org/。 点击进入看看~
libcurl无法找到
Description: runrails sget runtime error as shown below:
Reason:curl component is missing on your host .C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/f fi/library.rb:133:in `block in ffi_lib': Could not open library 'libcurl': The s (LoadError)ule could not be found. . Could not open library 'libcurl.dll': The specified module could not be found. . Could not open library 'libcurl.so.4': The specified module could not be found. . Could not open library 'libcurl.so.4.dll': The specified module could not be fou nd.
Solution:refer to solved issuebundle installorgem install过程 make failed
Description: 具体Error info 忘记了。。。
Reason:由于我的 ruby 安装在 D:\Program Files 下,就是由于路径名的 blank space导致 make failed
Solution:换个目录安装 ruby, 路径名不可有 blank space
相关文章推荐
- Ruby on Rails 路由解析
- 如何在Mac下配置Ruby环境
- [Ruby] defind? 运算符的使用
- 如何在Mac OS X上安装 Ruby运行环境
- 安装 Ruby 环境 -for-MAC
- Ruby的XML格式数据解析库Nokogiri的使用进阶
- 学习ruby on rails有什么好处
- ruby入门教程:入门ruby的方法
- ruby中Class的allocate
- ruby安装笔记
- Ruby on Rails 初次冲浪体验
- Ruby中使用Nokogiri包来操作XML格式数据的教程
- Ruby中XML格式数据处理库REXML的使用方法指南
- 实例解析Ruby程序中调用REXML来解析XML格式数据的用法
- Ruby使用REXML库来解析xml格式数据的方法
- Github+Jekyll —— 创建个人免费博客(二)Ruby+Jekyll部署
- ruby之对象体系
- Ruby Get Started
- ruby中星号(*)的功用
- ruby安装