2011-08-04 54 views
2

部署此問題時出現了一些問題。我試過現在部署兩次。以下是我迄今所做....將Chiliproject部署到Dreamhost中

安裝在install page所需的寶石和版本:

gem install -v=2.3.5 rails 
gem install -v=1.0.1 rack 
gem install -v=0.8.7 rake 
gem install -v=0.4.2 i18n 

下載的軟件包:

git clone git://github.com/chiliproject/chiliproject.git 
cd chiliproject 
git checkout stable 

必須找到並設置捆綁因爲它不在我的路徑:

BUNDLE="/usr/lib/ruby/gems/1.8/bin/bundle" 

將我的數據庫信息放入database.y毫升:

然後開始捆東西:

$BUNDLE install --without=postgres rmagick 
$BUNDLE exec rake generate_session_store 

最後的命令得到了錯誤:

rake aborted! 
can't activate rails (= 2.3.5, runtime), already activated rails-2.3.12. Make sure all dependencies are added to Gemfile. 

所以我在Gemfile中改變2.3.12至2.3.5,並進行了:

RAIL_ENV=production $BUNDLE exec rake db:migrate 

然後我得到了這個命令的錯誤太:

** Invoke db:migrate (first_time) 
** Invoke environment (first_time) 
** Execute environment 
rake aborted! 
undefined method `autoload_paths' for #<Rails::Configuration:0x68a68dbb82c0> 
/home/USERNAME/DOMAIN/public/config/environment.rb:44 

我嘗試註釋掉線44在那裏,但隨後拋出另一個錯誤undefined method convert_to_without_fallback_on_iso_8859_1' 爲Class'類,所以我不想它進一步發揮左右。 注意這隻發生在我第二次嘗試部署它。我第一次嘗試db:migrate succeeded(並且我檢查了數據庫中沒有數據)。

* 因此,對於第二次嘗試,我堅持在這裏:-(*

但是,這是發生了什麼DB後第一次:遷移succeded ....

RAILS_ENV=production $BUNDLE exec rake redmine:load_default_data 

隨着最後一個命令,但它失敗了說權限被拒絕爲mysql'user'@173.236.128.0/255.255.128.0',我就像是WTF試圖連接到一個網絡,就像它是一個主機?

所以我感動開啓,複製我的配置文件和env在ironment改變的文件/添加如下幾行:

# Uncomment below to force Rails into production mode when 
# you don't control web/app server and can't set it the proper way 
ENV['RAILS_ENV'] ||= 'production' 

# Specifies gem version of Rails to use when vendor/rails is not present 
RAILS_GEM_VERSION = '2.3.5'# unless defined? RAILS_GEM_VERSION 

if ENV['RAILS_ENV'] == 'production' # don't bother on dev 
    ENV['GEM_PATH'] = '/home/USERNAME/.gems' + ':/usr/lib/ruby/gems/1.8' 
end 

然後做這個東西可寫並重新啓動乘客:

chmod -R 777 files log tmp public/plugin_assets/ 
touch tmp/restart.txt 

對不起文本的牆上,是任何人都能夠在照一些輕我做錯了什麼?

在此先感謝。

編輯:所以這是完全錯誤的,這裏就是我得到了它的工作

rm ~/.gem* 
gem install bundler 

PATH=$PATH:/usr/lib/ruby/gems/1.8/bin 

cd ~ 
git clone git://github.com/chiliproject/chiliproject.git 
cd chiliproject 
git checkout stable 

cp * ../example.com/ -R 
cd ../example.com 

# Make sure database is working 

bundle install --without postgres rmagick test 
bundle exec rake generate_session_store 

RAILS_ENV=production bundle exec rake db:migrate 

# No output is no good, check database.yml 

RAILS_ENV=production bundle exec rake redmine:load_default_data 

或者看到這一點:https://gist.github.com/1127306

回答

3

當前ChiliProject穩定版本(2.x)需要使用捆綁器。因此Slotos的答案在這裏不正確。 gen安裝不起作用,我們需要捆綁器。

另外,我們現在需要Rails 2.3.12。如果您擅自編輯文件,則不會得到任何工作結果。在某些平臺上,您需要修改Gemfile(例如,在使用Ruby 1.8.6或某些版本的ImageMagick時)。對於使用Ruby 1.8.7或REE的當前建議的設置,您不需要適應任何東西。

用於安裝當前穩定ChiliProject 2.x版本的依賴關係,你基本上需要做到以下幾點:

首先,你需要確保其中的寶石二進制文件重新安裝到的目錄是在$PATH 。這可以暫時通過運行這個(你的情況)

export PATH=/usr/lib/ruby/gems/1.8/bin:$PATH 

然後,你需要安裝捆綁的寶石,並指示它安裝所有的依賴

gem install bundler 
bundle install --without rmagick postgres test # in your case 

什麼是你的情況真的很奇怪實現Rake似乎試圖啓用Rails 2.3.5。它不應該這樣做(並且除非你改變了某些文件)。我強烈建議從一個新的乾淨源代碼樹開始,不要更改任何任意文件。

+0

謝謝你。我被一個乘客錯誤卡住,說它找不到寶石,但沒有說出哪一個。我跑了你說的命令,它開始工作耶!這裏是我使用的命令列表,使其工作https://gist.github.com/1127306再次感謝:) – hamstar

1

不要混淆了捆綁包管理gem install命令。你會得到意想不到的結果。

如果你真的想使用捆綁器 - 將所有你想要的寶石添加到Gemfile。 否則只是省略它。

快速搜索「bundler chiliproject」將我導向chiliproject-gemfile。顯然它已經合併成不穩定了。

+0

謝謝你,謝謝你,我放棄了寶石安裝,並開始使用打包機...乘客說它找不到寶石壽...做到這一點 - 沒有測試似乎工作壽。 – hamstar