2011-11-21 44 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'