Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3 bundler & rvm: bundled gems don't show up in gem list?

ubuntu 10.04 slimy lynx or whatever it's called is the OS for a production app. I've installed rvm too, and other then being on a mac, the dev and production rubies and gems are the same.

Now, I'm used to seeing all of the bundled gems in gem list... like normal, however when i do gem list in production, I am not shown any bundled gems.

This means i can't use rails c or any other gem.

I've found out that i can do bundle exec rails c or something and use the console that way, but I'm more interested in why this is happening, and how to fix it so gem list has all the gems. it just feels right.

Thoughts?

like image 266
pjammer Avatar asked Nov 28 '25 20:11

pjammer


1 Answers

When in development mode on your mac, the gems still get installed in the default gem path, whereas in production mode, they get installed in a folder specific to your project. Try doing a bundle show rails on each machine and you'll see what I mean.

When you run gem list it looks in the main gem folder, and since your production gems are sitting in a project-specific folder, the global gem command doesn't know to look there. So you will need to do a bundle exec to run any of those project-specific gemscommands on the server. For my purposes, I created a be alias to bundle exec. Also, to list your project's gems, you can do bundle list.

See http://gembundler.com/v1.3/rationale.html#deploying-your-application for the rationale behind this.

like image 197
Dylan Markow Avatar answered Nov 30 '25 12:11

Dylan Markow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!