加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 使用Ruby on Rails安装CMS引擎. (机车)

发布时间:2020-12-16 20:59:11 所属栏目:百科 来源:网络整理
导读:机车作为轨道上的ruby的开源CMS,我想安装. 我在他们的“入门”项目中表现得很好,但我在安装机车CMS引擎时遇到了麻烦. 这是一个要求的链接: http://doc.locomotivecms.com/guides/get-started/requirements …这里是安装CMS引擎的实际指南的链接: http://do
机车作为轨道上的ruby的开源CMS,我想安装.

我在他们的“入门”项目中表现得很好,但我在安装机车CMS引擎时遇到了麻烦.

这是一个要求的链接:

http://doc.locomotivecms.com/guides/get-started/requirements

…这里是安装CMS引擎的实际指南的链接:

http://doc.locomotivecms.com/guides/get-started/install-engine

好的,首先,需要安装Ruby,至少版本为1.9.3:

接下来,需要安装imagemagick. Imagemagick是一个开源软件套件,用于显示,转换和编辑光栅图像文件.安装后,它警告我,我安装了mac端口或fink,即使我已经删除了它们.我不知道如何处理那些畸形的物体!

无论如何,让我们继续前进.现在我们需要安装rails版本3.2.11:

大.现在我们需要安装MongoDB,一个开源文档数据库和领先的NoSQL数据库.

这里有一些问题.
Launchctl没有退货吗?为什么不?运行’Mongod’也没有任何结果.不好的迹象.

现在,需要安装rake和bundler.没问题:

接下来需要安装旅行车宝石. Wagon是LocomotiveCMS引擎的命令行站点生成器.没有投诉的安装:

最后是应用程序生成的时候了!我称之为’myapp’并使用以下命令创建它:

rails new myapp --skip-active-record --skip-test-unit --skip-javascript --skip-bundle

现在我输入’myapp’的根目录:

cd myapp

在Gemfile中包含相关的gem:

group :assets do
gem 'locomotive_cms','~> 2.0.1',:require => 'locomotive/engine'
gem 'unicorn',:group => 'development'
gem 'compass-rails','~> 1.0.2',:group => 'assets'
gem 'sass-rails','~> 3.2.4',:group => 'assets'
gem 'coffee-rails','~> 3.2.2',:group => 'assets'
gem 'uglifier','~> 1.2.4',:group => 'assets'
end

运行’bundle install’.没问题:

但在这里,我认为这是错误发挥作用的地方.它与Mongoid有关.

以下命令用于将引擎路由插入主应用程序:

bundle exec rails g locomotive:install

它会导致以下警告:

create  config/initializers/locomotive.rb
  create  config/initializers/carrierwave.rb
  create  config/initializers/dragonfly.rb
  create  config/mongoid.yml
    rake  db:mongoid:migration:install/usr/local/rvm/gems/ruby-1.9.3-     p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable    dir /usr/local in PATH,mode 040777
rake aborted!
Failed to connect to a master node at localhost:27017
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mongo-1.5.2/lib/mongo/connection.rb:413:in      `connect'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mongo-1.5.2/lib/mongo/connection.rb:574:in     `setup'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mongo-1.5.2/lib/mongo/connection.rb:104:in     `initialize'

rake  db:mongoid:migrate
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:197:     warning: Insecure world writable dir /usr/local in PATH,mode 040777
rake aborted!
Failed to connect to a master node at localhost:27017
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mongo-1.5.2/lib/mongo/connection.rb:413:in  `connect'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mongo-1.5.2/lib/mongo/connection.rb:574:in   `setup'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mongo-1.5.2/lib/mongo/connection.rb:104:in   `initialize'

说明还说“在config / mongoid.yml中配置你的mongodb主机名和数据库名称.”我把它们留作:

defaults: &defaults
host: localhost
port: 27017
# slaves:
#   - host: slave1.local
#     port: 27018
#   - host: slave2.local
#     port: 27019

development:
<<: *defaults
database: locomotive_dev

test:
<<: *defaults
database: locomotive_test

说明还说在config / initializers / locomotive.rb中设置“多站点激活,默认语言环境,电子邮件发件人(等)”.再一次,我只是把它留作:

Locomotive.configure do |config|
 config.multi_sites = false
 config.default_locale = :en
 config.enable_logs = true
 config.mailer_sender = 'support@example.com'
end

现在是时候的真相.启动服务器:

bundle exec unicorn_rails

在这上花了六个小时.我得到的只是

E,[2013-04-29T20:41:49.223219 #40521] ERROR -- : reaped #<Process::Status: pid 40527 exit 1>     worker=0
I,[2013-04-29T20:41:49.223661 #40521]  INFO -- : worker=0 spawning...
I,[2013-04-29T20:41:49.225155 #40528]  INFO -- : worker=0 spawned pid=40528
I,[2013-04-29T20:41:49.225574 #40528]  INFO -- : Refreshing Gem list
E,[2013-04-29T20:41:52.211379 #40528] ERROR -- : Failed to connect to a master node at localhost:27017 (Mongo::ConnectionFailure)

总之一句话:awergohiewgiohegwhioewgiohwefiohfwaehioiohawefiohawefhioaewfohiafwehioafwiohaiofwehiofaewiohaefwihoefwahioaefwhioaefwhoiiohaefwhioefwhioaefwhioaefwhioaefwiohafewiohaefwohifaewiohaefwhioafewhiofaewhiofewaiohefwaohieawfiohfewhiofewhiofeawhiofaewhoieafwhioawefhioawfeiohawfeohi.

如果有人可以帮忙,我会这样,所以,非常感谢.我认为这是关键:

Failed to connect to a master node at localhost:27017 (Mongo::ConnectionFailure)

解决方法

您需要启动mongo数据库引擎.

就在跑步之前:

bundle exec unicorn_rails

sudo mongod --dbpath /usr/local/var/mongodb --fork --logpath /var/log/mongodb.log

启动unicorn rails服务器现在将导致无错误.

可选,运行

tail -f /var/log/mongodb.log

在应用程序与数据库交互时查看实时日志!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读