ruby on rails 环境搭建
建议参考:http://ruby-china.org/wiki/install_ruby_guide
以下为自我摸索安装
1、安装ruby
sudo apt-get install ruby1.9.1
完成后,输入ruby -v,查看ruby的版本
参考:http://www.ruby-lang.org/en/downloads/
2、安装RubyGems
RubyGems is the standard Ruby package manager. It's similar to apt-get, emerge, and other OS package managers. Download
http://rubygems.org/pages/download
Download from above.
Unpack into a directory and cd there
Install with: ruby setup.rb (you may need admin/root privilege)
注意权限问题,如果没有权限,请授权,或者使用root
3、 安装rails
gem install rails --include-dependencies
结果老报错:
Building native extensions. This could take a while...ERROR: Error installing rdiscount:ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mkmf (LoadError)from <internal:lib/rubygems/custom_require>:29:in `require'from extconf.rb:1:in `<main>'
在网上找到两篇文章:
http://blog.moonflare.com/2011/10/25/installing-ruby-1-9-2-and-gems-on-ubuntu-11-10/
http://adamcaudill.com/2011/05/16/errors-on-gem-install-mysql2/
然后分别执行:
apt-get install ruby1.9.1-dev
apt-get install libxml2-dev
apt-get install libxslt1-dev
sudo apt-get install libsqlite3-dev
sudo REALLY_GEM_UPDATE_SYSTEM=1 gem update --system
然后再执行 gem install rails --include-dependencies
安装成功
执行rails -v
显示:Rails 3.2.3
4、rails代码路径:
https://github.com/rails/rails/tree/v3.2.3
MagicLinux2.0下配置Ruby on Rails开发环境
http://blog.csdn.net/liupopo/article/details/1367658
5、Ubuntu, Ruby, RVM, Rails, and You-(Ubuntu安装Rails)
http://www.cnblogs.com/kelby/archive/2011/10/12/2208446.html