Bundle --deployment & --no-deployment

So O have a working 3.1.2 application. I had done a
bundle install --deployment

Now I want to add nokogiri so I added
gem ‘nokogiri’
to the Gemfile

I then did


c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run bundle install elsewhere and add the
updated Gemfile.lock to version control.

You have added to the Gemfile:

  • nokogiri

c:\RailsInstaller\Sites\ultradedup002> bundle install
You are trying to install in deployment mode after changing
your Gemfile. Run bundle install elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running bundle install --no-deployment.

You have added to the Gemfile:

  • nokogiri

c:\RailsInstaller\Sites\ultradedup002> bundle install --no-deployment
.
.
.

c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment


What’s going on? Why do I need to go through these contortions?

Ralph S.

The machine where you run bundle --deployment, is that a development
machine or a deployment machine?? because on http://gembundler.com/ it
states

Deploying Your Application
On production servers, you can enable deployment mode:

$ bundle install --deployment

Do not use this flag on development machines. The --deployment flag
turns on defaults that are appropriate for a deployment environment.
Gems
are installed to vendor/bundle and the Gemfile.lock must be checked in
and
up to date before Bundler is run.

This is how i do it…

After i create the rails app i run

bundle install

then run,

bundle package

which vendors the gems. Now anytime i need to add any new gem I add it
to
the Gemfile and run ‘bundle install’ which installs the gem and vendors
it
too.

At the top of my ‘deploy.rb’ file i have *require
“bundler/capistrano”*which handles deployment automatically.

This just works for me.

Gautam P.

Re[2]: [Rails] bundle --deployment & --no-deployment

Saturday, December 31, 2011, 3:24:37 AM, you wrote:


I am so lost.


I'm trying to deploy to Heroku and I am very unfamiliar with procedures for it.


Am I even able to do a bundle whatever on the server they provide?





The machine where you run bundle --deployment, is that a development machine or a deployment machine?? because on http://gembundler.com/ it states



Deploying Your Application 

On production servers, you can enable deployment mode: 

$ bundle install --deployment

Do not use this flag on development machines. The --deployment flag turns on defaults that are appropriate for a deployment environment. Gems are installed to vendor/bundle and the Gemfile.lock must be checked in and up to date before Bundler is run. 



This is how i do it..


After i create the rails app i run


bundle install


then run,


bundle package


which vendors the gems. Now anytime i need to add any new gem I add it to the Gemfile and run 'bundle install' which installs the gem and vendors it too.


At the top of my 'deploy.rb' file i have require "bundler/capistrano" which handles deployment automatically.


This just works for me.


Gautam P.



On Sat, Dec 31, 2011 at 6:57 AM, Ralph S. <[email protected]> wrote:


So O have a working 3.1.2 application.  I had done a

 bundle install --deployment



Now I want to add nokogiri so I added

 gem 'nokogiri'

to the Gemfile




I then did


- - - -


c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment

You are trying to install in deployment mode after changing

your Gemfile. Run `bundle install` elsewhere and add the

updated Gemfile.lock to version control.


You have added to the Gemfile:

* nokogiri


c:\RailsInstaller\Sites\ultradedup002> bundle install

You are trying to install in deployment mode after changing

your Gemfile. Run `bundle install` elsewhere and add the

updated Gemfile.lock to version control.


If this is a development machine, remove the Gemfile freeze

by running `bundle install --no-deployment`.


You have added to the Gemfile:

* nokogiri


c:\RailsInstaller\Sites\ultradedup002> bundle install --no-deployment

.

.

.


c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment


- - - -



What's going on?  Why do I need to go through these contortions?


Ralph S.


--

You received this message because you are subscribed to the Google G. "Ruby on Rails: Talk" group.

To post to this group, send email to [email protected].

To unsubscribe from this group, send email to [email protected].

For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




-- 

You received this message because you are subscribed to the Google G. "Ruby on Rails: Talk" group.

To post to this group, send email to [email protected].

To unsubscribe from this group, send email to [email protected].

For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.





-- 

Best regards,

 Ralph                            mailto:[email protected]



You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.

To post to this group, send email to
[email protected].

To unsubscribe from this group, send email to
[email protected].

For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Sat, Dec 31, 2011 at 5:31 AM, Ralph S. [email protected]
wrote:

I’m trying to deploy to Heroku and I am very unfamiliar with procedures for it.

Have you read their instructions? It’s really pretty simple.

Am I even able to do a bundle whatever on the server they provide?

You don’t need to; Heroku uses your Gemfile to make the required
gems available to the app at deployment.


Hassan S. ------------------------ [email protected]

twitter: @hassan

Hassan,

Am I even able to do a bundle whatever on the server they provide?

HS> You don’t need to; Heroku uses your Gemfile to make the required
HS> gems available to the app at deployment.

Dear God!

One sentence and “everything” snaps into focus.

Thank you!

Question: Does that mean I can’t add more gems to the gemfile when I do
the next upload?

If I need to fix one .rb file (or whatever), do I have to upload the
entire app?

I have sooo many questions.

For instance, will Heroku, for a fee, be my ISP for the app? That is,
will they host my app and my url: www.ultradedup.com?

Ralph

Hassan,

Saturday, December 31, 2011, 11:27:29 AM, you wrote:

HS> On Sat, Dec 31, 2011 at 10:18 AM, Ralph S. [email protected]
wrote:

Question: Does that mean I can’t add more gems to the gemfile when I do the
next upload?

HS> No, each deployment reads the Gemfile and loads what it needs.

If I need to fix one .rb file (or whatever), do I have to upload the entire
app?

HS> Sure, but it’s just git push heroku master and wait a minute –
not a
HS> big deal. Though for quick deployments anywhere it’s a good idea
HS> to separate out large assets (images, video, sound) to some cloud
HS> storage provider (e.g. AWS S3).

jw_player needs to have videos somewhere in public.

Can a link to cloud storage be placed there? I am a complete noobie
when it comes to cloud stuff and heroku.

Ralph S.

On Sat, Dec 31, 2011 at 10:18 AM, Ralph S. [email protected]
wrote:

Question: Does that mean I can’t add more gems to the gemfile when I do the next
upload?

No, each deployment reads the Gemfile and loads what it needs.

If I need to fix one .rb file (or whatever), do I have to upload the entire app?

Sure, but it’s just git push heroku master and wait a minute – not a
big deal. Though for quick deployments anywhere it’s a good idea
to separate out large assets (images, video, sound) to some cloud
storage provider (e.g. AWS S3).

I have sooo many questions.

For instance, will Heroku, for a fee, be my ISP for the app? That is, will they
host my app and my url: www.ultradedup.com?

That’s exactly their business, yes :slight_smile:


Hassan S. ------------------------ [email protected]

twitter: @hassan

On Sat, Dec 31, 2011 at 2:18 PM, Ralph S. [email protected]
wrote:

jw_player needs to have videos somewhere in public.

Can a link to cloud storage be placed there? I am a complete noobie when it
comes to cloud stuff and heroku.

This has nothing to do with Heroku specifically.

I’ve never used fw_player, but a quick glance at the docs shows it
(apparently) accepts a URL as a ‘file’ argument. Easiest way to find
out is try it.

Create an Amazon S3 account and upload a video file to it; put that
URL in a page on your development machine. When it works there,
it’ll work anywhere :slight_smile:


Hassan S. ------------------------ [email protected]

twitter: @hassan

Using deployment mode with bundler requires an up-to-date Gemfile.lock.

See here:
http://gembundler.com/man/bundle-install.1.html#DEPLOYMENT-MODE