Rvm VS Native Installation of Ruby

RVM vs native installation of ruby

Use RVM. Because it is more simple.

You'll have all distributions in one place, all gems in one place, and you're using the same tool that you use in development. There are no performance issues either.

bundle install using wrong ruby with rvm when building native extension?

I was using the wrong bundle.

$ which bundle
/usr/bin/bundle

Either the one included in Ubuntu 16.04 is old, or using the system-installed bundler doesn't work with rvm-installed Ruby.

$ gem install bundler
Fetching: bundler-1.16.1.gem (100%)
...
1 gem installed
$ which bundle
/home/roger/.rvm/gems/ruby-2.3.4@junk-drawer/bin/bundle

That looks better.

$ bundle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using bundler 1.16.1
...
Bundle complete! 1 Gemfile dependency, 9 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

Lesson learned: when using rvm, remember to gem install bundler as well.

Is RVM production ready?

I built RVM for production and added the developer 'niceties' later on.
If you would like more information read the documentation on the website and come talk to me in #rvm on irc.freenode.net sometime during the day EDT most days.

Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v

You have broken version of RVM. Ubuntu does something to RVM that produces lots of errors, the only safe way of fixing for now is to:

sudo apt-get --purge remove ruby-rvm
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh

open new terminal and validate environment is clean from old RVM settings (should be no output):

env | grep rvm

if there was output, try to open new terminal, if it does not help then restart your computer.

install RVM:

\curl -L https://get.rvm.io | 
bash -s stable --ruby --autolibs=enable --auto-dotfiles

If you find you need some hand-holding, take a look at Installing Ruby on Ubuntu 12.04, which gives a bit more explanation.

Installing linecache19 for Ruby 1.9.2 via rvm

You may be having the same problem as I was. When I ran bundle install I got the error:

Installing linecache19 (0.5.12) with native extensions
/Users/joseph/.rvm/rubies/ruby-1.9.2p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions':
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/Users/joseph/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb

From http://isitruby19.com/linecache19 I found that this worked:

gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-p290

Building native extensions error in installing ruby gems

First of all, set the Ruby version you are using as a default

rvm use --default ruby-1.9.3-p448-dev

and uninstall the gem previously installed with sudo

sudo gem uninstall travis

this makes sure that all your commands are using the same Ruby version and your machine is clean again. Now to your installation problem. This error

Permission denied - /home/user/.travis/travis.sh (Errno::EACCES)

shows you, that the installer tried to access /home/user/.travis but wasn't able to do so due to a lack of user permissions. This means you need to make sure that the folder belongs to you and is writeable

chown -R `whoami` ~/.travis
chmod -R u+wx ~/.travis

Now go ahead and try to re-install:

gem install travis

and everything should be fine.



Related Topics



Leave a reply



Submit