狂欢安装问题 - 使用RVM

时间:2010-11-14 08:01:16

标签: ruby-on-rails ruby spree

我正在尝试使用以下说明安装spree gem http://spreecommerce.com/resources/quick-start

安装工作正常,但尝试创建应用程序无法解决

bash: spree: command not found

路径是 /Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/bin:/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0@global/bin:/Users/sandbox1/.rvm/红宝石/红宝石1.9.2-P0 /斌:/Users/sandbox1/.rvm/bin:在/ usr / bin中:/ bin中:/ usr / sbin目录:/ sbin目录:在/ usr / local / bin目录:在/ usr /本地/ git的/ bin中:在/ usr / X11 / bin中:在/ usr / X11 / bin中 bash-3.2 $

我应该将以下输出中的内容添加到我的PATH中吗?

bash-3.2$ find $HOME -name spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree-0.30.0/rdoc/lib/generators/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree_auth-0.30.0/rdoc/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree_core-0.30.0/rdoc/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree-0.30.0/lib/generators/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_auth-0.30.0/app/controllers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_auth-0.30.0/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/app/controllers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/app/helpers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/public/images/spree
bash-3.2$ 

2 个答案:

答案 0 :(得分:3)

Chris说:你可以创建一个rails 3.0应用程序并将spree gem添加到应用程序,如http://spreecommerce.com/documentation/getting_started.html#creatinga-new-spree-project中所述。

  1. 使用例如rails new spreetest
  2. 创建项目
  3. gem 'spree'添加到Gemfile
  4. 执行bundle install安装缺失的宝石
  5. 使用rails g spree:siterake spree:install
  6. 初始化狂欢网站
  7. (可选)安装示例数据rake spree_sample:install
  8. 使用rake db:bootstrap
  9. 填充数据库
  10. 使用rails server
  11. 运行服务器

答案 1 :(得分:-1)

根据我在Spree主页上看到的内容,他们建议您使用sudo执行Gem安装。但是,RVM says you should not use sudo。尝试再次安装Gem,这次没有sudo