2011-11-21 43 views
0

嗨,我是一個開發rails應用程序的新手,我有興趣 使用'狂歡'爲我的電子商務網站。狂潮發電機不工作時,類型'rails g spree網站'

我下面這個教程大禮包從這個網站 http://guides.spreecommerce.com/getting_started.html

  1. 我做了一個新的安裝爲上面的教程指導我。我使用rails 1.9.3和mysql 數據庫將其作爲'5.1啓動Spree'的一部分。一切都很好,直到我注意到登錄欄不是像教程那樣出現 。

  2. 我做了一些研究,害得我到這個解決方案中 https://github.com/railsdog/deface/issues/12 我從這篇文章中瞭解,似乎問題使用Ruby 1.9.3, 當來自從污損寶石一個「錯誤」,但問題不會出現在1.9.2中,因此我將ruby 版本更改爲1.9.2以試用它。

  3. 在我安裝了ruby 1.9.2後,我安裝了'spree'gem,我重複了'入門 教程'中的項目(使用mysql數據庫)來完成教程。

  4. 現在在部分4.4.2,其中i型 '耙分貝:創建' 端子輸出本

    商店$耙分貝:創建

    store_test已經存在
    store_development已經存在

  5. 當我試着通過'rails g spree:site'生成狂歡網站,終端給我這個錯誤

store rails g spree:site 
      create config/spree.yml /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/spree_core-0.70.2/lib/generators/spree/site/site_generator.rb:16:in 
    `block in config_spree_yml': undefined method `version' for 
    Spree:Module (NoMethodError) from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in 
    `call' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in 
    `render' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in 
    `block (2 levels) in invoke!' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in 
    `open' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in 
    `block in invoke!' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `call' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `invoke_with_conflict_check' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:61:in 
    `invoke!' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions.rb:95:in 
    `action' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:26:in 
    `create_file' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/spree_core-0.70.2/lib/generators/spree/site/site_generator.rb:15:in 
    `config_spree_yml' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in 
    `run' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in 
    `invoke_task' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in 
    `block in invoke_all' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in 
    `each' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in 
    `map' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in 
    `invoke_all' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:226:in 
    `dispatch' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in 
    `start'  from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.2/lib/rails/generators.rb:168:in 
    `invoke' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.2/lib/strong textrails/commands/generate.rb:12:in `<top (required)>' from 
    /Usestrong textrs/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in 
    `require' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in 
    `block in require' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:223:in 
    `block in load_dependency' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:640:in 
    `new_constants_in' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:223:in 
    `load_dependency' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in 
    `require' from 
    /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.2/lib/rails/commands.rb:28:in 
    `<top (required)>' from script/rails:6:in `require' from 
    script/rails:6:in `<main>' 
  1. 我很迷惑,因爲我沒有之前創建一個數據庫(但它顯示出它的存在)。而現在我甚至不能生成 狂歡網站。我研究了這個問題幾天,我還沒有找到一個 匹配解決方案。這是我的Gemfile看起來像

    源「http://rubygems.org」

    gem 'rails', '3.1.2' 
    
    # Bundle edge Rails instead: 
    # gem 'rails',  :git => 'git://github.com/rails/rails.git' 
    
    gem 'mysql2' 
    
    
    # Gems used only for assets and not required 
    # in production environments by default. group :assets do gem 'sass-rails', '~> 3.1.5.rc.2'  gem 'coffee-rails', '~> 3.1.1' 
    gem 'uglifier', '>= 1.0.3' end 
    
    gem 'jquery-rails' 
    
    # To use ActiveModel has_secure_password 
    # gem 'bcrypt-ruby', '~> 3.0.0' 
    
    # Use unicorn as the web server 
    # gem 'unicorn' 
    
    # Deploy with Capistrano 
    # gem 'capistrano' 
    
    # To use debugger 
    # gem 'ruby-debug19', :require => 'ruby-debug' 
    
    group :test do # Pretty printed test output gem 'turn', '0.8.2', 
    :require => false 
    
    gem 'spree' , '0.70.2' 
    
    end 
    
  2. 我真的很感激,如果有人可以給我一些指點或解決我的問題。我現在很迷茫,它肯定會讓 有人開心。 (告訴我,如果u需要我的紅寶石更多信息 環境)

+0

是否需要運行0.70版本?你應該全光照如果可能的話,最新的。您上面鏈接的說明適用於比最新版稍早的版本(只有delta是最新的版本需要3.2.9)。您似乎沒有遵循這些說明,因此您至少需要更正您的0.70入門文檔的鏈接。 –

回答

1

你已經開始用新的Rails應用程序?下面是使用紅寶石1.9.2p290(昨天)我做了什麼,Rails的3.1.1在Fedora 16:

  1. 確保ImageMagick的安裝中 - 引導腳本不會沒有它的工作。

  2. 運行Rails新應用程序的名字--database的MySQL

  3. CD APPNAME

  4. 添加寶石, '大禮包', '0.70.3' 來的Gemfile

  5. 運行捆綁

  6. 配置database.yml

  7. 運行rake db:create - igno重新任何數據庫中存在錯誤

  8. 運行軌道產生大禮包:現場 - 忽略任何數據庫中存在錯誤

  9. 運行耙分貝:引導

這應該是它。

1

剛剛實現 - 在「:test」組裏面有「gem'spree'...」。不好。不要與Gemfile混淆 - 只需在最後添加狂熱寶石即可。

1

截至今天(2012年12月2日)大禮包的當前版本是用Ruby 1.9.3兼容和軌道3.2.9是狂歡-v「1.2.2"

http://spreecommerce.com/blog/2012/11

版本1.3被設置在2012年12月

我不是專家釋放,但我認爲你需要在你的Gemfile改變

gem 'spree', '1.2.2'