2

I'm making a simple chat application, and I am using Heroku to temporarily host my application. Thus, I have to use the PostgreSQL gem and Rails_12factor gem. Since I have to put the gem code in the production group in my Gemfile, as I have learned previously, I get this code:

source 'https://rubygems.org'

gem 'rails', '4.2.4'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'

gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

group :development do
    gem 'sqlite3'
end

group :production do
    gem 'pg'
    gem 'rails_12factor'
end

In my Gemfile. When I save this file and go to the terminal to write this command:

bundle install --without-production

In the right directory and this is pretty much the right command, I think. However, I get this error:

Unknown switches '--without-production'

This has just recently began to happen, since it has worked many times in the past. All of this happened some time since the Rails 5.0 launch. Here are my rails and ruby versions:

ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
I can't find my Rails version, but it is somewhere in the Rails 4.0 area.

This is a very aggravating issue since I will not be able to actually do any work in Rails with this error. I'm still a beginner, and I haven't seen a single blog post with the same error as mine. Thanks, and more thanks in advance!

Hack Casts
  • 33
  • 6
  • 1
    In my experience, there's no problem in installing the production gems in the development environment. They won't be required or used in dev. The only issue is that they take up space in the HDD, but this isn't really an issue nowadays. – Rodrigo Castro May 20 '16 at 21:25
  • Agreed. I made an error in the bundle install without production command. I just made a slight mistake in my syntax, but once I caught my error, it seemed to work out. This is basically just a lesson for all the other beginners on StackOverflow who might make this mistake. – Hack Casts May 22 '16 at 16:09

2 Answers2

2

The right command to install your bundle should be as following

bundle install --without production

instead of

bundle install --without-production

You can check this page for more information.

Dharmesh Rupani
  • 1,029
  • 2
  • 12
  • 22
Nirupa
  • 787
  • 1
  • 8
  • 20
1

I figured out the solution as I was testing out bundler and found out that instead of using

bundle install --without-production

I am to use:

bundle install --without production

This was a miniscule error...

Hack Casts
  • 33
  • 6