I’m very new to Rails and I’m quite confused if I can practice Rails in
offline mode?
I’m following the Ruby on Rails Tutorail by Michael H. and I noticed
that after generating a new app through the command “rails new
app_name”,
“bundle install” is then called to download the gems specified in the
Gemfile.
What if I don’t have an internet connection? Can I still play with
Rails?
Sai Kiran Mothe, Thank you, but I am just wondering, “what if I am in a
remote area with no internet connection and want to play around with
Rails”. I just need an answer for that
Basically a good idea is to list down the gems needed by my app and gems
that I think I can use and then download them through “gem install”
command.
After that I can play around without an internet connection?
Sai Kiran Mothe, Thank you, but I am just wondering, “what if I am in a remote
area with no internet connection and want to play around with Rails”. I just need
an answer for that
Basically a good idea is to list down the gems needed by my app and gems that I
think I can use and then download them through “gem install” command.
After that I can play around without an internet connection?
I think you’d need to be on a network for bundle to work. Once you’ve
bundled an app, you can continue to work on it, but I doubt that bundler
would work without a net – the first thing it does is try to read the
latest updates from rubygems.org. You can simulate this pretty easily by
disabling all of your network and trying to run bundle update in an
existing (working) application. See if it succeeds without giving up.
If you already have the gems required by whatever you’re running, bundle install doesn’t hit the network - so, if you’ve already
generated one app successfully, you can continue to generate/work on
more offline without issue.
There are ways around this problem if you absolutely must, but in
general it’s expected that you have internet access at least
sometimes.
You can. To avoid being slowed down by needing to download Gems and
being
offline, you can use the “final version” of the Gemfile for the
sample_app,
which is listed in listing 9.49 (In Chapter 9) (don’t forget to use
bundle
install after editing your Gemfile!). Hartl mentions it early in
chapter
3, where the main project for his book (the “sample app”)
begins.
Iain
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.