- 浏览: 102215 次
- 性别:
- 来自: 苏州
文章分类
最新评论
-
z2009zxiaolong:
希望下次也有机会参加ruby大会。
ruby大会2011归来有感 -
w156445045:
freemarker 没用过。。
java web打印 -
klsmwz:
顶~~~ 非常好 要是有数据库文件那就更完美了 希望早点出来
我也开源啦!freemarker+struts2+Spring+Hibernate的JavaEE项目,大家来围观 -
freespace:
不错,很好。这个文章解决多版本rails共享方法很好。
RVM切换Ruby和Rails版本 -
lihbobo:
哥们,你听的真认真;我也求PPT中。。
ruby大会2011归来有感
ssh -qTfnN -D 7070 gazeldx@216.194.70.6 zj85..
听robbin说locomotivecms很棒,就下载来试试。我的环境是windows xp.后来在bundle install的过程中,发现有个叫kgio的gem无法正常使用,查资料发现该gem只能在unix-like OS下使用。所以就
安装UBUNTU
安装方法见我写的http://zhangjian1982.iteye.com/blog/1107268
然后要装ruby和rubygems还有rails啦,见http://wiki.rubyonrails.org/getting-started/installation/linux
安装ruby
如果用sudo apt-get install ruby -full build-essential这种方式安装到ruby的版本由ubuntu决定,如果自己想指定版本,则通过ftp://ftp.ruby-lang.org/pub/ruby/1.8/下载。
测试用ruby -v和$ ruby -ropenssl -rzlib -rreadline -e "puts :Hello" Will show:Hello
我建议你安装最新版本ruby,见http://www.ruby-lang.org/en/downloads/ 我建议你采用rvm的方式安装,详见我的另一篇博文。
sudo apt-get install ruby gems即可。但是这种方法安装会导致rails的命令不能作为命令行直接执行,所以我建议按照rubyonrails.org的官方写法:即http://rubyforge.org/frs/?group_id=126下载,然后解压缩,然后执行 sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem,
rubygems被装到了/usr/lib/ruby/gems下面。
安装rails
如果用sudo apt-get install rails。测试用rails -h 这种方式会把rails安装到/usr/bin/rails ,安装的版本往往不是rails的最新版本,这是不推荐的。我推荐官方到安装方式:sudo gem install rails ,即通过rubygems安装,这能安装最新版本。
/var/lib/gems/1.8/gems/这是通过sudo apt-get rubygems的安装rails的目标文件夹。
/usr/lib/ruby/gems/1.8/gems/这是通过自己编译ruby setup.rb安装rubygems后安装rails的目标文件夹
然后我开始
rails new tweb
报错
bundle install后发现报sqlite3的错误:Installing sqlite3 (1.3.4) with native
extensions /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:483:in
`build_extensions': ERROR: Failed to build gem native extension.
(Gem::Installer::ExtensionBuildError)
用sudo apt-get install libsqlite3-dev
和sudo gem install sqlite3-ruby解决
安装locomotive CMS
按照它官网的方法安装(因为有墙,所以我在文后加上相关内容),安装时如果执行bundle install报错,则执行sudo gem install bundler即可 (look:Bundler is a tool that manages gem dependencies for your ruby application. 后来报错:
Could not find gherkin-2.5.2 in any of the sources,可能和我使用了rails3.1版本有关。目前locomotivecms是用3.0.10,因为这个问题,我没有安装成功,所以,我们现在必须把版本换到3.0.10,方法见:我之前写的一个文章,你可以搜索RVM http://zhangjian1982.iteye.com/blog/1222579
)。
这时要执行bundle install了。下面两个错误一般都会报,所以如果你打算节省时间,直接解决掉再执行。
*报错nokogiri 。。 native extension libxml2 is missing,用sudo apt-get install libxslt-dev libxml2-dev 解决
*报错Installing rmagick (2.12.2) with native extensions /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/bin/ruby1.8 extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.12.2. Can't find Magick-config in /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Can't find Magick-config
解决办法:
sudo apt-get install libmagick9-dev
sudo apt-get install libmagickwand-dev
在Engine installation方法下,bundle exec rails g locomotive:install会报错 :解决办法见本文下面的介绍!
bundle exec unicorn_rails启动rails
最后访问http://127.0.0.1:8080/admin OK啦。
官方安装说明:
Installation guide
Locomotive runs on my different platforms, but it's optimized for the Bushido hosting platform. Bushido enables Locomotive to set subdomains and custom domains directly, launch with built-in email accounts, and provides highly reliable hosting, all with a single click.
We suggest you to start to read the requirements
section. Then choose one of the installation methods.
If you want to test Locomotive and sneak into the code, we recommend you the from source
installation.
Let us know if you have any suggestions or if you find bugs .
Requirements
Ruby
Of course :-)
We tested it with both Ruby 1.8.7 (2009-06-12 patchlevel 174) and Ruby 1.9.2.p0 which are two of Ruby versions Heroku supports.
Please note that performances are much better with Ruby 1.9.2 and the stability seems okay (no bugs found for now).
Mongodb
Locomotive CMS does not use a classic sql database such as mysql or postgresql but rather a nosql database named mongodb.
Mongodb is available on many OS. Check this link out for more information.
Note: We suggest you to take a version from 1.6.0.
ImageMagick
Uploaded images for asset collections are cropped, for example, and Locomotive uses ImageMagick for this purpose. Again, ImageMagick is available on a large set of OS.
Note: On Mac OS X, try Homebrew or MagickInstaller to install it. This will save you a couple of hours because its installation can be really painful sometimes.
Browsers (back-office)
We haven't had time to test the IE versions. So for now, we ask you to use the Locomotive back-office with the following browsers: Safari , Firefox and Chrome
From source installation
This way of installing Locomotive is recommended when you want to add new features, correct bugs or see how Locomotive works internally.
1. Get source code from github.
git clone git://github.com/locomotivecms/engine.git locomotive
cd locomotive
2. Install gems.
bundle install
3. Edit the Locomotive settings.
mate config/initializers/locomotive.rb
Note: If you run Locomotive in local and with the multi-sites mode on, do not forget to update your /etc/hosts file accordingly.
By default, Locomotive uses Amazon S3 in production. To change it, modify the carrierwave initialization file.
mate config/initializers/carrierwave.rb
4. You also may want to change your mongodb connection settings.
mate config/mongoid.yml
5. Run the application server.
bundle exec unicorn_rails
6. Open your browser.
open http://localhost:8080/admin
7. Follow the instructions in the browser to create your first account and site.
8. (ONLY IN PRODUCTION ) Push the assets used by the Locomotive back-office to Amazon S3 for better performances.(Jammit-S3 ).
export S3_KEY_ID=<your s3 key id>
export S3_SECRET_KEY=<your s3 secret key>
export S3_BUCKET=<your s3 bucket name>
jammit-s3 --force
If you do not want to push the assets in S3 and instead leave them in your application, remove the lines about S3 in the config/assets.yml file and run the following command:
jammit --force
Engine installation
This is probably the cleanest way to build your own comprehensive hosting CMS platform because the Locomotive core cannot be broken and all you need to do is add your own content.
1. First, create a Rails project.
rails new my_platform -O -T -J
cd my_platform
rm public/index.html
2. You have to tell your Rails app that you want to include the Locomotive gem available on Gemcutter. Edit your application Gemfile and add these lines if missing.
gem 'rails', '3.0.10'
gem 'locomotive_cms', :git => 'git://github.com/locomotivecms/engine.git', :require => 'locomotive/engine'
gem 'unicorn', :group => 'development'
3. Install gems
bundle install
4. Add the Locomotive config files and assets
bundle exec rails g locomotive:install
(注意:这句话执行很可能报错rest - client - 1.4 . 2 / lib / restclient . rb : 9 : in `rescue in <top (required)>':
no such file to load -- net/https. Try running apt-get install libopenssl-ruby (LoadError)
解决办法:
$ sudo apt-get install build - essential bison openssl libreadline5 libreadline5 - dev curl git zlib1g zlib1g - dev libssl - dev libsqlite3 - 0 libsqlite3 - dev sqlite3 libxml2 - dev
$ rvm remove
1.9
.
2
$ rvm pkg install openssl
$ rvm install 1.9 . 2 - C -- with - openssl - dir = $HOME /. rvm / usr
)
5. Edit the locomotive settings
mate config/initializers/locomotive.rb
By default, Locomotive uses Amazon S3 in production. To change it, modify the carrierwave initialization file.
mate config/initializers/carrierwave.rb
6. You also may want to change your mongodb connection settings
mate config/mongoid.yml
7. Run the application server
bundle exec unicorn_rails
8. Open your browser
open http://localhost:8080/admin
9. Follow the instructions in the browser to create your first account and site.
10. (ONLY IN PRODUCTION ) Push the assets used by the Locomotive back-office to Amazon S3 for better performances (Jammit-S3 ).
export S3_KEY_ID=<your s3 key id>
export S3_SECRET_KEY=<your s3 secret key>
export S3_BUCKET=<your s3 bucket name>
jammit-s3 --force
If you do not want to push the assets in S3 but leave them in your application instead, remove the lines about S3 in the config/assets.yml file and run the following command
jammit --force
发表评论
-
Mac搭建Ruby on Rails Postgresql解决方案
2014-07-19 14:20 541Maccbook OSX10.8.2 注意1 :HomeBr ... -
Unicorn 服务器
2012-02-11 16:20 815production 模式下,每次都需要重新启动unicorn ... -
rails疑问
2012-01-14 14:40 697cookies 的理解还不够透彻。应该主要是单向用的吧,即从s ... -
fsfsdsdffsdsd
2011-11-17 14:40 1sfdssfdsdafsddddddddddddddddddd ... -
rails多域名配置
2011-11-10 13:52 1231多域名配置我认为最好是通过程序实现。先给出部分代码: #abc ... -
ruby and rails常用命令整理
2011-11-07 15:42 885Rubygems gem uninstall rake -v ... -
rails下使用rich editor kindeditor和ckeditor对比记录
2011-11-03 09:22 2052本文原来是介绍ckeditor ... -
ruby on rails开发相关疑问和待研究技术
2011-10-24 13:43 782疑问 列的索引在create_table的时候能够创建吗?我 ... -
Ruby On Rails异常和解决汇总
2011-10-12 16:52 895/usr/lib/ruby/gems/1.8/gems/ex ... -
locomotiveCMS的疑问
2011-09-13 17:02 10它是如何实现当进行 rails generate scaffo ... -
Rails Guide学习心得和疑问
2011-07-20 14:54 1078疑问: has_and_belongs_to_many :h ... -
locomotiveCMS使用心得和疑问
2011-07-11 16:41 887疑问: 它是如何实现当进行 rails genera ... -
RubyOnRails的学习心得
2011-07-11 15:21 918Firm#clients.create (similar ... -
HAML的点点滴滴
2011-07-11 13:45 1149待解决问题: 如何去掉空格?换行难免会产生空格。 h ... -
ubuntu中安装RubyMine
2011-07-07 17:44 98听说rubyMine作为ruby on rails的IDE不错 ... -
待完成任务
2011-06-29 12:29 0如何让mongodb自动作为startup bootup启动? ...
相关推荐
Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 ...
在这个全球互联的世界中,计算机编程和 Web 应用程序开发都在迅猛发展,我很期待能为中国的开发者提供 Ruby on Rails 培训。学习英语这门世界语言是很重要的,但先通过母语学习往往会更有效果。正因为这样,当看到 ...
Ruby on Rails Guides v2 - Ruby on Rails 4.2.5
Ruby On Rails中文教材(PDF)
ruby on rails社区网站开发源码
《ruby on rails web开发学习实录(配光盘)》基于ruby 1.9.2和rails 3.0.3全面探讨ruby on rails框架的组成部分。全书共分17章,主要内容包括:搭建ruby on rails开发平台、ruby语言的基础知识(像控制语句、面向对象...
ruby on rails对mongodb的操作ruby on rails对mongodb的操作ruby on rails对mongodb的操作ruby on rails对mongodb的操作
该资源包包括在Linux安装Ruby on Rails所需的包,以及安装步骤文档
除了讲到 Ruby on Rails 之外,涉及到的技术还有 HTML、CSS、数据库、版本控制、测试和部署。为了达成学习目标,本书使用了一个完整的方案:通过实例学习使用 Rails 从零开始创建一个真正的程序。如 Derek Sivers 在...
本书教您如何使用Ruby on Rails开发和部署真正的,具有工业实力的Web应用程序,Ruby on Rails是为诸如Twitter,Hulu,GitHub和Yellow Pages等顶级网站提供支持的开源Web框架。
Ruby On Rails 官方教程,这本书讲解如何使用 Ruby on Rails 框架开发应用,以及如何把应用部署到生成环境。...这本书是《Ruby on Rails Tutorial, Third Edition》的简体中文版,由作者授权翻译和销售。
Windows7_Cygwin_Git_RVM_Ruby1.9.3_Rails3_MongoD B_Nginx_Unicorn_Rspec_Guard_Spork(2-Ruby on Rails3 安装配置
ruby on rails 教程源码,配合原书使用
Ruby On Rails 框架自它提出之日起就受到广泛关注,在“不要重复自己”,“约定优于配置”等思想的指导下,Rails 带给 Web 开发者的是极高的开发效率。 ActiveRecord 的灵活让你再也不用配置繁琐的 Hibernate 即可...
ruby on rails最新版 这是本人精心收集的重要软件
ruby on rails 开发环境包(ruby1.8.7,rails2.2.3)
Ruby on Rails中文指南
ruby on rails api方便查阅
最新Ruby on Rails中文版介绍,欢迎大家共同学习此最新的技术!随着Ruby和Rails版本的不断升级,这些知识也在不断的更新,谢谢的支持!