I'm looking for a solution to the "RVM is not a function" issue when installing RVM on Raspbian using LXTerminal. The following thread discusses workarounds for this issue:
rvm installation not working: "RVM is not a function"
One solution would be to start the terminal in "login mode" by doing /bin/bash --login, but this does not help on Raspbian because it uses LXTerminal. Other people have suggested putting the following line at the end of your .bash_rc file:
source ~/.rvm/scripts/rvm
...which seems to work. Just wondering if (a) the above workaround is legit and will not screw anything up and (b) if anybody has found a more elegant solution for RVM on Raspbian.
It looks like the best solution is to run it with:
lxterminal -e "bash -li"
It will make the terminal use an login and interactive shell.
I tried this but when in the root application directory for a ruby on rails application it stopped working, I added this 'source /usr/local/rvm/scripts/rvm' to my .bashrc file which worked in the /home/user/ folder and the root ruby on rails application folder
Related
I have this bash: rbenv: command not found thing always coming up on my terminal whenever I open it and they appear four times as shown below.
I am using windows, please, how do I fix this? All solutions I have researched are tailored toward MacOs.
bash: rbenv: command not found
bash: rbenv: command not found
bash: rbenv: command not found
bash: rbenv: command not found
I am using windows, please, how do I fix this? All solutions I have researched are tailored toward MacOs.
The error is coming from bash, a Unix shell. It's unclear how that's running on Windows (perhaps Windows Subsystem for Linux?) but the MacOS (really Unix) instructions should work.
Presumably you installed rbenv in this Unix on Windows environment at some point and now it's gone. If you want it back, install it again.
If you want it gone, follow the uninstall instructions. rbenv will add a line rbenv init to your shell startup configuration files. In bash, look at your .bashrc and .bash_profile files in your home directory and remove anything to do with rbenv.
If you don't know how to use bash, see Introduction to Bash for more.
I'm on OS X host where I have RubyMine (7) and last Vagrant installed. I've prepared shell script for provision my vagrant box with RVM, ruby (2.1.2), bundle my project, run all tests, manually start server. Everything seems fine.
Now I want to make RubyMine works with RVM ruby from vagrant guest (run server, specs with debugging). I've added remote ruby SDK, point them to RVM ruby binary (http://prntscr.com/5i6g1f). But when I try to start development server, I've receive message that no rails installed in SDK. But it is installed via bundle, I can run server manually from guest.
Please, advice me how can I tell RubyMine where to find gems inside Vagrant with RVM?
Thanks :)
When using RVM, the path to remote SDK should not point to the binary but rather to the ruby gems directory.
In your case, for instance, the correct path should be:
/home/vagrant/.rvm/gems/ruby-2.1.2
Note that it should point to the DIRECTORY not the executable!
To find the directory simply run:
$ rvm gemdir
Then copy and paste the result.
change the path to ruby
from: /path/to/rvm/rubies/ruby-version/bin/ruby
to: /path/to/rvm/wrappers/ruby-version/ruby
Same problem if any rbenv user face then type "which ruby" without quotes in terminal it will point to the shims folder of rbenv but select versions folder and select irb instead of ruby as rubymine need irb (ruby interpreter) instead of ruby binary.
I'm trying to setup passenger with rvm. I keep getting this error
Your RVM wrapper scripts are too old.
Please update them first by running
'rvm update --head && rvm reload &&
rvm repair all'.
I did that still same problem
GNU C++ compiler... found at /usr/bin/g++
Curl development headers with SSL support... found
OpenSSL development headers... found
Zlib development headers... found
Ruby development headers... found
OpenSSL support for Ruby... found
RubyGems... found
Your RVM wrapper scripts are too old.
Please update them first by running 'rvm update
--head && rvm reload && rvm repair all'.
I'm using Fedora 14, Ruby 1.9.2, Rails 3.0.7
RVM is installed for multiuser
I also get this error when I do 'passenger start'
Cannot execute
'/home/antarr/.passenger/standalone/3.0.7-x86_64-ruby1.9.2-linux-gcc4.5.1-1002/support/helper-scripts/prespawn
http://0.0.0.0:3000': Permission
denied (13)
I was having the same issue but found that using the rvmsudo command worked. Instead of
sudo passenger-install-apache2-module
try using:
rvmsudo passenger-install-apache2-module
It looks like Passenger 3.0.7 is confused by newer versions of rvm, but it seems like the instructions are incorrect and it's causing trouble. If the GEM_HOME environment variable is not set you get this error.
The correct instructions should be to use your particular version first:
rvm use 1.9.2
Although I got the same error as you, after that it worked for me.
If none of the above solutions work for you and you're getting the GEM_HOME warning
delete everything in .rvmrc
rvm get head && rvm reload && rvm repair all
gem install passenger
passenger-install-apache2-module
copy/paste the end message into your apache.conf
I am still having the same issue with passenger 3.0.19 if I tried to install on gemsets other than default and global. This is soooo troublesome. I have tried many suggestions and even rvm implode, then have everything brand new. but still hitting the brick wall. my forehead almost flatten. Hope not to lose my head!
Luckily, I found myself a fix. I found out that in i am in rvm multiuser envrioment and the issue arised if I switch to user gemset using command: "rvm user gemsets" which basically will create and use .rvm folder in user's home folder. e.g.: /home/.rvm instead of /ur/local/rvm folder. Since I do not know how to switch back and could not find any documention on how to, I did the following steps:
remove .rvm folder in the user home folder,
rm -rf ~username/.rvm
added back the user to rvm group (in multi enviroment, every new user need to be added to rvm group)
sudo usermod -a -G rvm username
re-login.
Now, as long as I am using shared rvm gemset folder, phusion passenger wont complaint.
Hope that helps someone.
I fixed the Permission Denied issue with:
chmod a+x /Users/tvd/.passenger/standalone/3.0.7-x86_64-ruby1.9.2-macosx-10.6/support/helper-scripts/*
Found it in comment section on the phusion.nl blog:
Goto Comment on Phusion Blog
History:
Read into Deploying Rails3 app to a
Mediatemple DV server.
Installed RVM on the server, ruby, and essential gems.
Site works fine if I FTP it up.
All good.
I then decided to do a proper deployment and setup for GIT/cap deploy as per "Agile Web Development with Rails".
Attempted deploy with cap, but had errors with gems not available to the production site.
Read around and realised I should probably go for a system wide RVM install.
Removed all gems and RVM.
Installed RVM system wide.
Error on cap deploy "bash: /home/foo/.rvm/bin/rvm-shell: No such file or directory", which makes sense - there is no .rvm/ in the home directory.
Thinking something was hanging over from initially installing RVM to use as a user, I removed the user, deleting the home directory, and recreated the user with permissions.
Same error on cap deploy "bash: /home/foo/.rvm/bin/rvm-shell: No such file or directory"
The situation now is:
For foo, .bashrc contains the last line:
[[ -s '/usr/local/lib/rvm' ]] && source '/usr/local/lib/rvm'
When I issue:
type rvm | head -1
the response is "rvm is a function".
/etc/rvmrc contains
if [[ ! -s "$HOME/.rvm/scripts/rvm" ]]; then
umask g+w
export rvm_selfcontained=0
export rvm_prefix="/usr/local/"
fi
Running out of ideas here, and hoping for some suggestions.
Next time try to add this in your capistrano:
set :rvm_type, :system
It seems like rvm-shell is not in your rvm install directory. Run this command
rvm get head
Then you'll get it right in your rvm bin directory.
I just wanted to add to #imonyse's comment.
the head branch of rvm might be a tad too unstable for some deploys. I know our deprecated SLES boxes have a tendency to choke on it. It might be advisable to get the most recent stable version.
rvm get stable
Also don't do this on a really old server running production code as it may have undesired consequences.
I'm trying to connect to SQL Server on Ubuntu 9.04 using Ruby. I translated and followed all the steps outlined in getting OSX talking to SQL Server from here:
http://toolmantim.com/articles/getting_rails_talking_to_sqlserver_on_osx_via_odbc
Everything is working on the FreeTDS and unixODBC end. I can see and query the database using tsql.
When I try to access the database from Ruby using IRB I get the following error:
DBI::DatabaseError : INTERN (0) [RubyODBC] Cannot allocate SQLHENV
Has anyone run into this and what can I do to solve this?
I started getting this error when I upgraded to Ubuntu 9.10 (Karmic Koala). Your tip regarding installation order of the Ubuntu packages didn't work for me.
It seems the fix was to manually compile ruby-odbc.
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz
tar xzvf ruby-odbc-0.9997.tar.gz
cd ruby-odbc-0.9997
ruby extconf.rb --with-dlopen
make
sudo make install
System
Ubuntu 9.10 64 bit
I had to specify the odbc directory in the rubyodbc install
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz
tar xzvf ruby-odbc-0.9997.tar.gz
cd ruby-odbc-0.9997
ruby extconf.rb --with-odbc-dir=/usr/lib/odbc --disable-dlopen
make
sudo make install
I had the same problem.
But on Centos 5.5 not Ubuntu
Tried many forums/solutions with no joy.
The error message hints at a missing reference to unixODBC.
Which was setting using LD_LIBRARY_PATH variable.
Found another way to set path, by creating
/etc/ld.so.conf.d/odbc.conf.
add unixODBC location to file ie /usr/local/lib.
Run, sudo ldconfig.
Go fig that I actually got this working after submitting my question. What I ended up doing was uninstall libdbd-odbc-ruby and libdbi-ruby and then reinstalling them by installing libdbi-ruby first and then installing libdbd-odbc-ruby. I guess when I installed them before, something must of messed up.
BTW, following the instructions to recompile Ruby-ODBC on Ubuntu 9.10 (Karmic) required installation of either the libiodbc2-dev or the unixodbc-dev package. When using libiodbc2-dev, I got segmentation faults when my Ruby program tried:
connection.select_all('select top 15 * from log_device_healths')
..but no problem when using unixodbc-dev instead.
Tim Morgan's solution didn't work for me. However I was able to get things working by installing an older version of libodbc-ruby (0.9995) from here:
http://mirrors.kernel.org/ubuntu/pool/universe/libo/libodbc-ruby/libodbc-ruby1.8_0.9995-1_i386.deb
Additional details are available from Carsten Gehling's blog:
http://gehling.dk/2010/02/the-woes-of-libodbc-ruby1-8-and-debian-ubuntu/
Be careful though -- Ubuntu's Update Manager will happily "upgrade" this version of libodbc-ruby to the broken 0.9997-2. I accidentally overwrote the older version this way only to end up back here, trying to figure out how I fixed it last time.
Well, it seems my other answer stopped working for me. This thread helped me to solve the issue in another way, and I wanted to share it here.
sudo gem uninstall ruby-odbc
sudo rm /usr/local/lib/site_ruby/1.8/x86_64-linux/odbc.so
cd /tmp
wget http://mirrors.kernel.org/ubuntu/pool/universe/libo/libodbc-ruby/libodbc-ruby1.8_0.9995-1_amd64.deb
sudo dpkg -i libodbc-ruby1.8_0.9995-1_amd64.deb
If you're not on a 64-bit platform, you'll need to download a different Debian package.
Basically, what solves the problem is installing version 0.9995 of the ruby-odbc Ubuntu package.