hguser
hguser

Reputation: 36018

use third part gem in rails application

I am new in rais.

And I meet some problems when I want to use some third-part gems.

For example,I try to use 'cancan' in my system,and I am using rails 3.2.5 now.

When I install 'cancan' like this:

gem install cancan.

I found that it depends "activepack 3.2.6" which is not the same as what I am using(3.2.5)

So I wonder what will happen if I use 'cancan' in my application?

Also,how to import the 'cancan' to my cpp? Since in java I will put the related .jar file to the /web-info/lib path, and import it in the source code. How in ruby?

Upvotes: 0

Views: 147

Answers (2)

Alex Teut
Alex Teut

Reputation: 844

When you write gem install cancan, you do not add this gem to your project, you just download and install it in system.

If you want to install gem in your app, write gem 'cancan' in your Gemfile (in your project folder), and then write bundle install in console. Bundle tries to solve all your gem dependencies and adds gem to your project. If your gems are incompatible, bundler will return error with description of problem.

Upvotes: 1

Nils Landt
Nils Landt

Reputation: 3134

Have a look at bundler to manage your gem installation.

As far as version incompatibility goes, check Ahbay Kumar's answer.

Upvotes: 0

Related Questions