Pry looking for wrong version - rvm

I'm using RVM in a small repository and trying to spin up a Pry console. Pry 0.12.2 is installed as a gem in my #global gemset and not present in the repository's bundle. However, every time I run it I get
$ pry
Could not find proper version of pry (0.11.1) in any of the sources
Run `bundle install` to install missing gems.
I have tried reinstalling it, using gem uninstall -axI, which should have removed any executables, but no luck.
Why else might it be asking for a version that isn't present anywhere relevant?

Related

RVM doesn't recognize installed gem, so bundle install fails

Bundle install command fails because gem install pg fails:
Make sure that `gem install pg -v '0.17.1'` succeeds
I can though, install pg with certain options:
gem install pg -- --with-pg-include=/usr/pgsql-9.3/include --with-pg-dir=/usr/pgsql-9.3
Still.. running bundle install fails, saying:
Make sure that `gem install pg -v '0.17.1'` succeeds
Well ye I know it fails, that why I installed it before, with options given,
How do I make the bundle see it the gem is already installed.? (or maybe make the bundle command to run gem install pg -- --with-pg-include instead of gem install pg -v '0.17.1' so it will succeed)
I also use rvm, and i'm rather clueless about it, so maybe even though I the pg gem is installed:
gem list pg
*** LOCAL GEMS ***
pg (0.17.1)
The application doesn't recognized the installed pg gem? if so How do I make the application's rvm see that the required gem is already installed?
Thank you
Finally found answer: How can I pass a parameter for gem installation when I run bundle install?
So in my case:
bundle config build.pg --with-pg-include=/usr/pgsql-9.3/include --with-pg-dir=/usr/pgsql-9.3
bundle install
And that took a day, well could have been worse
So you know in the future, this wasn't an RVM issue. This was a bundler and gem command parameter passing issue. RVM wasn't involved at that stage.

WebStorm LESS Filewatcher Could not find RubyGem less

I'm getting this error trying to use the WebStorm LESS File Watcher
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem less (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
from /Users/me/.rvm/gems/ruby-1.9.3-p194/bin/lessc:18
from /Users/me/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14
I'm running OSX Mountain Lion
How do I fix it?
EDIT:
I did this...
gem install less
Successfully installed less-2.3.2
1 gem installed
Didn't help.
EDIT 2:
I fiddled with the path in the LESS Filewatcher setup panel
and now I get this
/Users/me/.rvm/gems/ruby-2.0.0-p195/bin/lessc --no-color bootstrap.less
env: ruby_noexec_wrapper: No such file or directory
It feels like progress, but alas I'm not compiling less to css yet.
You don't need to remove any ruby version. Just switch to the system version of ruby and install the compiler.
rvm use system
sudo gem install less
rvm use default
Ok what I did was this
With rvm remove all other versions of ruby
rvm remove 2.0.0-p195
Install this gem in the system version of ruby
sudo gem install rubygems-bundler
install the less gem
sudo gem install less
sudo gem install therubyracer
I am sure someone can give me a better way of doing this but this ruby thing has a pretty steep learning curve that I really am not interested in pursuing.
This is the way I did it...if someone wants to contribute a better way please share here to save someone else the 4 hours I just lost to it.

Omniauth + Devise Error: Could not find hashie-1.2.0

I add this to Gemfile:
gem 'omniauth-facebook'
Then I run bundle update. No problem so far. But when I run rails server I get this error:
Could not find hashie-1.2.0 in any of the sources
Run `bundle install` to install missing gems.
I thought that bundler was supposed to resolve and satisfy all dependencies, but I tried this anyway:
gem install hashie-1.2.0
Which gave this:
ERROR: Could not find a valid gem 'hashie-1.2.0' (>= 0) in any repository
ERROR: Possible alternatives: hashie-model
I'm new to Rails and I feel I'm at a dead end. Suggestions?
UPDATE: I also have run bundle install (to be exact bundle install --without production) several times. I get the same error when running rails server after that.
UPDATE: I aslo tried adding gem 'hashee' in the Gemfile before omniauth-facebook. No luck.
So I think you are just using bunder incorrectly.
bundle update doesn't resolve new dependencies, it simply looks at the gem manifest, which is stored in Gemfile.lock and updates those gems to the most recent gem allow by the constraints placed on them in the Gemfile.
Since you are trying to install a new gem, what you what to run is bundle install which will make a comparison between your Gemfile and your Gemfile.lock and install any gems that are not listed in your Gemfile.lock.
I think bundle install should do the trick for you.
As a side note, bundler tries to make this as easy as possible for you by aliasing bundle to bundle install. So, unless you are explicitly looking to update your gems, you can just type bundle and get the behavior that you are expecting.
I got it working. I think it was some problem with bundler. I did some different things, and I have to admit that I'm not 100% sure what fixed it. I think what did it was this:
gem uninstall bundler
gem install bundler
bundle install mail
However, it did not work until my second reinstall I think. Upon the install command, it installed everything, not just mail and its dependencies. The only other thing I did was to delete /usr/bin/bundler after the first reinstall. It did not reappear.

Bundle install keeps installing to ./runner

Not sure what's going on here, but in my Rails 3 application, I type bundle install and at the end if says Your bundle is complete! It was installed into ./runner.
Weird because I have no idea where runner is coming from!
If I recall correctly, if you run something like bundle install ./runner it will remember the path ./runner. bundle install --system should fix it. i think.
See the manpage:
--path=<path>
The location to install the gems in the bundle to.
This defaults to the gem home, which is the location
that gem install installs gems to. This means that, by
default, gems installed without a --path setting will
show up in gem list. This setting is a remembered option.
--system
Installs the gems in the bundle to the system location.
This overrides any previous remembered use of --path.

Project broken with Bundler errors after RVM install

I installed RVM and installed 3 different rubies: 1.8.7, ree, and 1.9.2.
I have a Rails 3.0.9 project that uses 1.8.7.
Now when I try to run the 3.0.9 project, I get this error:
Could not find xml-simple-1.1.0 in any of the sources
However, the following command:
bundle show xml-simple
yields:
/Users/me/.rvm/gems/ruby-1.8.7-p334/gems/xml-simple-1.1.0
Looks right to me. What am I missing here? The application, when running, is clearly not seeing the right path. Yet Bundler, when run at the command line, sees it just fine. I am not certain where these paths are to be set. I am admittedly new to RVM, I installed it because I want to start a new edge project with 1.9.2.
Thank you for any help you can provide.
I needed to learn how to create a gemset, then switch to that gemset. You can always check your gem and ruby environment with rvm using:
rvm info
That's what clued me in. Once I "use"d the appropriate gemset where the gem was installed, it worked great.