Thursday, June 25, 2015

how to Gemfile


  • let’s create a project folder and throw this in a Gemfile:


source :rubygems
gem "sinatra"
gem "shotgun"
gem "cucumber"
gem "capybara"
gem "rspec"

bundle install

Optionally—if you’re using RVM—you could install these gems for this project only by running rvm --rvmrc --create 1.9.2@cucumber_example;
run this before bundle install)

http://code.tutsplus.com/tutorials/ruby-for-newbies-testing-web-apps-with-capybara-and-cucumber--net-21446


  • you can just google for whatever functionality you’re looking for. Once you find the gem, install it like this

gem install GEM_NAME

 If you’d like to upgrade, run
 gem update --system
 gem -v

 sudo gem install maruku
 sudo gem install aws-s3

 There are two ways you can use gems.
 Some are stand-alone ruby programs that you’ll run (most often from the command line) to do something.
 Then, there are gems that you’ll only use from inside projects
  Ruby doesn’t load everything by default, so you can use require to load extra libraries you want to use
 
  Once you build a project, you might want to share it, or use it on another computer. However, anyone else who runs it will need to have all the right gems installed
 
  Bundler is a gem itself; you can install it by running
  sudo gem install bundler.
 
  in the root of your project, create a file named Gemfile. This will declare what gems you need for this project.
  The first line(s) of your Gemfile will tell Bundler where to get your gems. Gems live in online repositories,


http://code.tutsplus.com/tutorials/ruby-for-newbies-working-with-gems--net-18977

No comments:

Post a Comment