我正在开始一个Rails教程,它告诉我在创建新的演示应用程序时编辑gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.0'
group :production do
gem 'pg', '0.12.2'
end
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug' 根据说明,当我尝试使用bundle install --without production bundle install该文件时,我得到以下错误:
You need to specify gem names as Strings. Use 'gem "development"' instead.当我返回到文件并将gem :development更改为gem "development"时,系统会告诉我:
Could not find gem 'development (>= 0) ruby' in the gems available on this machine.我是新手,当一套清晰的指令似乎与另一套指令冲突,而且都不起作用时,我真的不知道该怎么办,特别是因为我真的不明白这些术语的含义。
如果能帮上忙我们会很感激的,
发布于 2012-05-26 08:03:50
:development应该是一个群体,而不是一个宝石。试试这个:
group :development do
gem 'sqlite3', '1.3.5'
end这意味着开发组中的所有gem都应该加载到开发环境中。在这种情况下,在生产或测试中运行时将不会有sqlite gem。
这同样适用于生产组。
仅当为Asset Pipeline编译资源时才加载资源组。
https://stackoverflow.com/questions/10762590
复制相似问题