English 中文(简体)
不从事铁路轮 工场工作的原发电机
原标题:Spree generator not working when type rails g spree site

Hi i m a newbie for developing rails application and i have interest in using spree for my Ecommerce website.

I m following this tutorial in spree from this site http://guides.spreecommerce.com/getting_started.html

  1. I made a fresh install as the tutorial above guided me. I made it to the part 5.1 Starting up Spree using rails 1.9.3 and mysql database. Everything was fine until i notice the login bar wasn t appearing like the tutorial did.

  2. I did some research which led me to this solution in https://github.com/railsdog/deface/issues/12 what i understand from this article, it seems that the problem comes from a bug from the defacement gem when using ruby 1.9.3 , but the problem does not appear in 1.9.2 so i changed my ruby version into 1.9.2 to try it out.

  3. After i installed ruby 1.9.2 i installed spree gem I repeated the project (using mysql database) from the getting started tutorial to finish the tutorial.

  4. 现在,在4.4.2部分,一类面包::

    store$ rake db:create

    store_test already exists
    store_development already exists

  5. 当一试由铁路板制造假点时:现场,终点站给我这个错误。

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. I was pretty confuse because i didn t create a database before (but it is showing that it existed). And now i can t even generate spree site. I researched this problem for days and i haven t found a matching solution yet. This is what my Gemfile looks like

    source 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. I d really appreciate if someone can give me some pointers or solutions to my problems. I m quite lost right now, it ll sure make someone happy. (tell me if u need more information about my ruby environment)

问题回答

Have you started with a fresh Rails application? Here s what I did (yesterday) using Ruby 1.9.2p290, Rails 3.1.1 on Fedora 16:

  1. • 确保安装的图像Magick——boot锁套在未安装的情况下打赢笔。

  2. Run rails new appname --database mysql

  3. cd appname

  4. Addgem, spree ,0.70.3 to Gemfile

  5. Run bundle

  6. 没收数据库。

  7. Run rake db: create - ignore any database exists errors

  8. Run rails generate spree:site - ignore any database exists errors

  9. Run:boot

这应该是这样。

在“:测试”小组内,你将“高端......”。 不好。 Don tuck with the Gemfile - Just Add the spree gem at the end.

As of today (December 2nd, 2012) the current version of spree which is compatible with ruby 1.9.3 and rails 3.2.9 is spree -v 1.2.2"

http://spreebusiness.com/blog/2007/11

第1.3版定于2012年12月发布

I am no expert, but I think you need to change your gemfile to

gem  spree ,  1.2.2 




相关问题
Automatic Application Generator

Is it possible to write a automatic application generator that can output hundreds of applications/day? An application is just a series of binary values. If a super computer is put to generate ...

How do I make my generator discoverable by Rails?

When I m creating a gem, how do I make the generator discoverable by Rails? I have a generators directory with my generator inside. I symlinked it from ~/.rails/generators and it worked fine, but ...

Create a new Tuple with one element modified

(I am working interactively with a WordprocessingDocument object in IronPython using the OpenXML SDK, but this is really a general Python question that should be applicable across all implementations) ...

Doctrine schema.yml generator

I am pretty new to doctrine. I made two small projects with doctrine for my own but now I am about to create big project for my client. The project will have more than 50 tables. Is there any way of ...

Structured programming and Python generators?

Update: What I really wanted all along were greenlets. Note: This question mutated a bit as people answered and forced me to "raise the stakes", as my trivial examples had trivial simplifications; ...

SQL to LINQ generator

I am new to LINQ and just wanna know; is there any application in which I type standard SQL and it gives me its representing statement in linq?

热门标签