Reputation: 35
i have two project,which one called A
with Rails
another called B
just pure Ruby
code.
when i call A
controller actions named do_action
it will call B
rake tasks such rake dosomething
but i got error:
rake aborted!
cannot load such file -- pry
the gem pry
in B
Gemfile.
i want to know why rails project A
will need B
Gemfiles gems?
i think my linux env probelem? thk
Upvotes: 0
Views: 60
Reputation: 16507
Since you have call to rake dosomething
to other's project from the specific (first) one, the environment gems will be applied from the first project. So, either:
add the pry gem dependency into the first project
generate the second project, which is in pure ruby, as a gem, and add it as a dependency into Gemfile of your Rails project as follows:
gem 'your_ruby_project_gem', :path => 'path/to/your/ruby/gem/project'
The way is for the projects, which are current under a development, i.e. the argument :path
allows you to change the code under that path, so you gem will be also changed without reinstallation. Refer to more the bundler documentation. To run the Rails project you have to exec as follows:
bundle exec rails s
I prefer the second approach.
Upvotes: 1