2013-07-02 45 views
0

我一直在rails3中進行編碼,並解決了所有的依賴關係。現在,我已經回到了rails 2,並且存在很多依賴性問題。有沒有任何理智的方法來確保所有的gem和依賴項都是基於當前的rails版本自動解析的?使用ruby在rails上工作時的版本管理

我不斷收到此錯誤

`default_options': undefined method `write_inheritable_attribute' for Rails::Generator::Base:Class (NoMethodError) 

錯誤日誌

from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator/base.rb:90:in `<class:Base>' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator/base.rb:85:in `<module:Generator>' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator/base.rb:48:in `<module:Rails>' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator/base.rb:6:in `<top (required)>' 
from /home/saiesh/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/saiesh/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator.rb:37:in `<top (required)>' 
from /home/saiesh/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/saiesh/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/bin/rails:15:in `<top (required)>' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/bin/rails:19:in `load' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/bin/rails:19:in `<main>' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `eval' 
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `<main>' 

寶石列表

*** LOCAL GEMS *** 

的ActionMailer(3.2.13,2.3.12,2.3.8) actionpack(3.2.13,2.3.12,2.3.8)
activemodel的(3.2.13)
了activerecord(3.2.13,2.3.12,2.3.8)
的ActiveResource(3.2.13,2.3.12,2.3.8)
的ActiveSupport(3.2.13,2.3.12 ,2.3.8)
AREL(3.0.2)
波旁(3.0.1)
助洗劑(3.0.4)
捆綁(1.3.5)
打捆 - 卸載(1.0.1)
康康舞(1.6.10)
咖啡欄(3.2.2) coffee-script(2.2.0)
咖啡腳本源(1.6.2)
CommonJS的(0.2.6) 守護程序(1.1.9)
delayed_job的(3.0.5)
delayed_job_active_record(0.4.4) erubis(2.7.0)
execjs(1.4.0)
formtastic(2.2.1)
formtastic的自舉 (2.1.3)
HAML(4.0.3)
上調(1.2.3)
I18N(0.6.1)
旅程(1.0.4) jquery的護欄(3.0.1,2.3.0)
JSON(1.8.0)
雷(0.14.1)
以下(2.3.2)
不太導軌(2.3.3)
less-軌-fontawesome(0.5.0) libv8(3.11.8.17 x86的Linux)的
郵件(2.5.4)
meta_search(1.1.3)
MIME類型(1.23)
multi_json(1.7.7)
mysql(2.9.1) mysql2(0.3.11)
polyamorous(0 .5.0)
通曉(0.3.3)
機架(1.4.5,1.1.6)
機架緩存(1.2)
機架SSL(1.3.3)
架測試(0.6.2 )
rails(3.2.13,2.3.8)
railties(3.2。13)
耙>(10.1.0,10.0.4)
的RDoc(4.0.1,3.12.2)
REF(1.0.5)
的rubygems打捆(1.2.0)
RVM(1.11 .3.8)
SASS(3.2.9)
SASS-導軌(3.2.6) 鏈輪(2.2.2)
therubyracer(0.11.4)
托爾(0.18.1)
傾斜(1.4。 1)
樹頂(1.4.14)
twitter-bootstrap-r苦惱的(2.2.7)
tzinfo(0.3.37)
uglifier(2.1.1)

+0

你可以在你使用的寶石列表中添加錯誤日誌嗎? –

+0

請看我編輯的問題@ prasad.surase – Saiesh

+1

既然你使用rails 2,你不應該使用ruby 1.8而不是1.9.3? –

回答

0

爲什麼不把每個項目使用gemsets的?

您的應用程序稱爲.rvmrc

rvm use --create [email protected]_app_name 

用於爲例內創建一個文件:

rvm use --create [email protected]_app_name 

現在,當你運行捆綁它將寶石單獨的文件夾一樣在我的情況:

.rvm/gems/[email protected]_app_name 

在這種情況下,從一個應用切換到另一個應用會加載所需的gemset機智h寶石爲您的應用程序。這就像使用RVM在Ruby版本之間切換一樣。

相關問題