Ubuntu下配置ROR的一些体会

 

 

首页Linux教程

背景:

阅读新闻

Ubuntu下配置ROR的一些体会

[日期:2008-04-08]   来源:Linux公社  作者:Linux整理   [字体:]  

1、install ruby
apt-get install irb libdbm-ruby1.8 libgdbm-ruby1.8 libmysql-ruby1.8 libmysqlclient14 libopenssl-ruby1.8 libruby1.8-dbg mysql-common ri ri1.8 ruby1.8-dev

2、install rubygem
#?group_id=126&release_id=20667
wget
tar zxfv rubygems-1.1.0.tgz
cd rubygems-1.1.0
sudo ruby setup.rb
提示:
RubyGems installed the following executables:
/usr/bin/gem1.8
运行:gem1.8 update –system

3、install Rails and dependencies
sudo gem1.8 install rails –include-dependencies

4、intall Mongrel
sudo apt-get install build-essential
sudo gem1.8 install mongrel –include-dependencies

5、测试
rails 版本:
rails -v
Rails 2.0.2
建立测试应用:
rails cookbook
cd cookbook
./script/server
打开:3000/即可看到首页

注:
1、我在安装时,运行sudo ruby setup.rb时出现如下错误:
./lib/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
from ./lib/rubygems/custom_require.rb:27:in `require'
from setup.rb:48
解决方法如下:sudo apt-get install -f rdoc

2、在运行./script/server时出现如下错误:
=> Booting WEBrick...
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:159:in `require_frameworks': no such file to load -- openssl (RuntimeError)
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:88:in `process'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `send'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `run'
from /home/kokko/cookbook/config/environment.rb:13
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
... 7 levels...
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from ./script/server:3

出现此错误的原因是没有安装了libopenssl-ruby 的缘故

kokko@kokko-laptop:~/cookbook$ sudo apt-cache search libopenssl-ruby
libopenssl-ruby - OpenSSL interface for Ruby
libopenssl-ruby1.9 - OpenSSL interface for Ruby 1.9
ruby1.8 - Interpreter of object-oriented scripting language Ruby 1.8
libopenssl-ruby1.8 - OpenSSL interface for Ruby 1.8

这里使用的是ruby1.8,运行 sudo apt-get install libopenssl-ruby1.8 即可。 

Ubuntu 7.10下从source安装ruby

Ubuntu8.04版openoffice启动更快了

相关资讯       Ubuntu技巧  ROR 

   

本文评论   查看全部评论 (0)


评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

 

 

 

最新资讯

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/f639a4d098c6875c7ae3a4f0d7860871.html