English 中文(简体)
铁路宝石档案编辑
原标题:Rails gemfile editing
I m starting a Rails tutorial that tells me to edit the gemfile when creating a new demo app: 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 When I try to bundle install the file, using bundle install --without production, as per the instructions, I get this error: You need to specify gem names as Strings. Use gem "development" instead. When I return to the file and change gem :development into gem "development" I m instead told: Could not find gem development (>= 0) ruby in the gems available on this machine. I m new to this and really have no idea what to do when one set of clear instructions seems to clash with another and neither works, especially because I don t really understand what any of these terms mean. Help would be very much appreciated,
最佳回答
:development should be a group, not a gem. Try with this: group :development do gem sqlite3 , 1.3.5 end This means that all the gems inside the development group should be loaded in the development environment. In this case, you won t have the sqlite gem when running in production or test. The same applies to the production group. The assets group is loaded only when compiling the assets for the Asset Pipeline.
问题回答

暂无回答




相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签