Common commands for bundles
Common commands for bundles
Bundle is a package manager for Ruby that manages the dependencies required by Ruby applications. The following are some commonly used Bundle commands:
The following are commonly used Bundle commands:
1. bundle install : Install all gem packages and their dependencies listed in the Gemfile .
2. bundle update : Update all gem packages and their dependencies listed in the Gemfile.
3. bundle exec : Execute a command in the context of a gem package. 4. bundle show : Display the installation path of a gem package. 5. bundle list : List all installed gem packages and their versions. 6. bundle init : Create a new Gemfile. 7. Bundle package : Package all gem packages and their dependencies listed in the Gemfile into the vendor/cache directory. 8. bundle clean : delete all unused gem packages and their dependencies. 9. bundle config : Configure the global settings of the bundle, such as sources, agents, etc. 10. bundle add : Add a gem package to the Gemfile. 11. bundle remove : Remove a gem package from the Gemfile. 12. bundle lock : lock all gem package versions and generate a Gemfile.lock file.****
The above are commonly used Bundle commands. More commands can be viewed through bundle --help
.
bundle exec
is a command prefix used to run project-specific gem packages in a Ruby project.
Here are some common bundle exec
commands:
1. bundle exec rails server : Starts a Rails server, allowing you to access the application in a web browser and view its output
2. bundle exec rake db:migrate : Run database migrations to perform data schema changes
**3.**bundle exec rails generate : Generate template-based code, such as new controllers, models, views, etc.
**4.**bundle exec rails test : Run the test suite in your Rails application to confirm functionality before development and deployment.
5. bundle exec rails routes : Lists all routes defined in the Rails application.
6. bundle exec rspec : run RSpec tests
7. bundle exec guard : Start Guard to monitor file changes and automatically run tests
**8.**bundle exec cap production deploy : Use Capistrano to deploy to the production environment
9. bundle exec middleman build : Use Middleman to generate static websites
10. bundle exec jekyll serve : Start the Jekyll local server
11. bundle exec cucumber : run Cucumber tests
These are just some common examples, in fact bundle exec
can be used to run any command that requires a specific gem package.