[英]Installing a CMS Engine with Ruby on Rails. (Locomotive)
機車作為軌道上的紅寶石的開源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
在應用程序與數據庫交互時查看實時日志!
我刪除了設計初始化文件並運行了rails g devise:install
再次rails g devise:install
,然后啟動了unicorn服務器,一切正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.