RVM: Incorrect Ruby version referenced after removal - rvm

Just updated the version of Ruby (1.9.2 to 1.9.3) I have installed but now getting the following error when running rake:
$ rake
-bash: /Users/mike.simmonds/.rvm/gems/ruby-1.9.3-p0/bin/rake: /Users/mike.simmonds/.rvm/rubies/ruby-1.9.2-p180/bin/ruby: bad interpreter: No such file or directory
Any tips?

It appears reinstalling the rake gem has fixed it.

looks like a gem pristine task failed and you had older rvm, I have already changed the upgrade code to run upgrade for every gem separately and report you list of failed gems.
It's important to read outputs of rvm, even we try to automate things and make things very easy - sometimes there is not much we can do with the available tools.

Related

Trouble installing Rails

Ok, imploded my rvm today (for reasons I cannot remember now, and pretty much cursing myself for it) ...
Have installed it back.
Trying to install rails ...
This is what I keep getting:
ERROR: Error installing rails:
bundler requires RubyGems version >= 1.3.6
No idea what it means ...
How do I fix this?
Side Note:
Now I remember why I imploded my rvm. It was to install readline package. I wanted to have rails console, and thought that was the way to go ...
Try doing a
gem update --system
to update your RubyGems. It should put you in version 2.0.

require gem issue

I have installed google api client with the following code and it installed successfuly.
gem install google-api-client
I am using rails 3.0.3 so i also included the above line bundler and ran bundle install which went successfully.
I have also rvm installed. And created a gemset.
And when I run the following command in the terminal:
gem environment | grep INSTALLATION | awk '{print $4}'
It gives me the following result
/home/jamal/.rvm/gems/ruby-1.9.3-p194
When i try to execute the following code in scintilla outside the project directory. It gives me an error.
require 'rubygems'
require 'google/api_client'
ERROR:
usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- google/api_client (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
What is the main reason of this kind of error?
Possible chances are your editor does not loading the specific gemset in which you install the gem.
Please provide output of gem list google-api-client -d in your questions. So that I can figure it out exactly what is going one.
EDIT:
Another issue which usually occurs are the dual installation of ruby. When we do have a system level installation and a rvm installation, many editor got confused in it. They load up original system installed ruby which do have prefixes like 1.8.7, 1.9.1and available in /usr/share/bin/. Where was you had installed the gem in rvm profile. To overcome this problem you must run your code from terminal after choosing the right gemset
I had that google/api_client (LoadError) message but, it concerned another Google gem.
gem 'google_drive', '~> 0.3.10'
gem 'google-api-client'
I just removed the , '~> 0.3.10' part in case of it was a compatibility problem. That did the trick:
Using google-api-client 0.7.1 (was 0.9.4)
Installing google_drive 1.0.6 (was 0.3.11)

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.

Getting Rails working with a JS runtime environment

I'm using Ubuntu 11.10 and the terminal to install and run Rails. Here
is the process I've taken so far to setup Rails:
download and install Ruby 1.9.2 and Rails 3.1.0
-- I did this using sudo apt-get ruby1.9.1 and sudo gem install
rails
I made a new rails app using rails new path/to/app
I went to the new app directory and tried running rails server and got an
error about not having a JS ruby environment
I had to get a JS runtime environment for execjs so I downloaded 'therubyracer'
as well as 'therubyrhino' and added them to my gem file, one at a time like this:
gem
'therubyracer' then ran bundle install
After everything was successful with the install, I ran rails server again
-- with both runtime environments I have had similar errors:
Could not find libv8-3.3.10.4 in any of the sources
Run `bundle install` to install missing gems.
Could not find therubyrhino-1.73.0 in any of the sources
Run `bundle install` to install missing gems.
Bundle knows where these programs live, giving correct pathnames when I
enter bundle show libv8 or bundle show therubyrhino. They are both
in /usr/lib/ruby/gems/1.9.1/gems/_ where all the other gems are
located for the bundle install.
Does anyone know where this exception is coming up in the Rails source
code? Does anyone know how Rails is gathering the gems? Better yet,
anyone had this problem and know how to fix it?
Thanks so much,
Feav
Have you tried starting the server using bundle exec rails server?
This problem has been fixed in a newer version of Rails.

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.