i got several problem runnings ruby and rails. I installed ruby via Macports. How to I remove everything and reinstall everything from the ground up?
Thanks,
To uninstall from MacPorts:
port uninstall ruby
I recommend installing rvm and using it to manage all of your ruby versions. Start here: http://rvm.beginrescueend.com/
Once you have it installed, reload your shell and type:
rvm install ruby-1.9.2
Once that is done, type
rvm use ruby-1.9.2 --default
This will replace your system ruby with the rvm 192 version. Feel free to install any other versions and switch to them using rvm list and rvm use.
For me this code worked very well sudo apt-get autoremove ruby
Related
So I'm following this guide at http://railsapps.github.io/installrubyonrails-ubuntu.html
and I install RVM without a hitch. However, when I check for the version of ruby that I installed via:
ruby -v
I got the following:
The program 'ruby' can be found in the following packages:
* ruby1.8
* ruby1.9.1
Try: sudo apt-get install <selected package>
I tried to install ruby manually through RVM:
rvm install ruby
However, it merely told me that ruby had already been installed.
Has anyone encountered this same issue?
TIA
you can try with these urls these may help you for installing rvm and ruby installation and rails installation
https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm
This may help you
After installing rvm, if you installed it as root, try
source /etc/profile.d/rvm.sh
If you installed as user, try
source ~/.rvm/scripts/rvm
I've definitely been there. I created a script to help me install ruby on remote machines. This was made for new EC2 instances, but maybe it will work.
https://github.com/jubrad/install_ruby
If you do want to use it you'll likely have to remove rvm and your rubies first.
-https://rvm.io/rubies/removing
-sudo apt-get remove rvm
best of luck.
Accidently I have installed both versions of ruby on my system and now the default version is set to
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
but I need to set the default version to 2.0.0...
for this I used the command
$ rvm 2.0.0p294 --default
but it says rvm is not currently installed though I installed it, typing various commands(via google) .
Also I want to install an Integrated Ruby shell in ubuntu 13.04, do suggest how to do it.
I have also installed Aptana Studio on my system, now how should I get started with it.
Finally, the last problem is tell me how to check whether rails is currently installed in my system or not...
Thanx in advance!!
to use a gemset try writing
rvm use ruby_gemset_version
to check the rails version try to type rails -v
you have to install RVM (ruby version manager), then you have control to use any specific versions of ruby, and coming to rails you have to manually install rails gem once you have installed rvm and selected a version.
This would be helpful to install rvm
https://rvm.io/rvm/install
After installation you have to install ruby versions.
Then you can use the following cmd
$ rvm use 2.0.0
to use ruby 2.0.0
Thank you.
Go to this http://rvm.io/rvm/install It has instruction to install and cofigure RVM. It is dependant on CURL lib. So make sure you have curl installed in your system, if not then the command is
#sudo apt-get install curl
Once it is intalled and configured properly.
On Ubuntu:
GoTo Terminal > Profile Preferences > Title and Command > Set checkbox for (Run command as login shell)
Install rubies using rvm install.
I am on a fresh install of OS X Mountain Lion. I have installed rails via:
sudo gem install rails
Everything seems to install correctly, but when I type the rails command (rails s, rails -v, etc), I get this error:
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
The result of 'which rails' is /usr/bin/rails
I thought it was a path issue, and perhaps it is, but I can see that /usr/bin is part of my PATH.
Any help? Thanks!
UPDATE: I noticed everything on my other mac with same exact OS works pretty well... I just can't remember how I got it to work that way. If I run 'which rails' I see it's in a totally different place /Users/username/.rvm/gems/ruby-1.9.3-p194/bin/rails
If you're using rbenv, don't forget to rbenv rehash after installing/updating ruby.
Use RVM http://rvm.io or rbenv to install newer Rails versions than what come pre-installed with OS X.
Follow examples on the site https://rvm.io/rvm/install/ but basically:
Install RVM: $ \curl -L https://get.rvm.io | bash -s stable
You can then $rvm list known to see what Rubies are available to you (lots). And simply $rvm install 1.9.3 to get the most current version of Ruby (which as of this writing is ruby-1.9.3-p327)
Set that ruby as your default $rvm --default use 1.9.3
Create a default gemset to store your gems $rvm use 1.9.3#mygemset --create --default
Then install Rails $ gem install rails will get you current which today is same as typing gem install rails -v 3.2.9
Just had this issue using rbenv, no idea how this happened, but figured that my ~/.rbenv/shims/rails was empty...
So to fix this:
Cleaned empty shims: find ~/.rbenv/shims -empty -delete
Then regenerate: rbenv rehash (was not overwriting empty one...)
I had the same problem.
After typing:
sudo gem install rails
and installing rails correctly, just close the Terminal window and open again. Then type:
~ $ rails -v
Rails 4.0.2
So, reseting the Terminal window fix the problem.
I think install rvm that will help you
rvm get head && rvm reload
rvm install 1.9.3
rvm use 1.9.3#current --create --default
The last line creates a gem set called current.
Now check to make sure you RubyGems was installed correctly by typing which gem in your terminal. Now update your gems.
gem update --system 1.8.24
Finally install rails.
gem install rails -v 3.2.3
I hope this works, let me know if you have any issues.
Yes, OSX comes standard with a lot of great software for Ruby on Rails, as well as PHP, Mysql, etc. However, sometimes it's better for sustainment purposes to use a 3rd party installer to get everything you want without digging through your /usr/ directory.
I recommend checking out http://railsinstaller.org/
With one easy install, you have everything you could want for a Rails project, including common software people use, and the site even has a tutorial. I recommend going this way. It saves you time. Plus, it comes with an easy uninstaller that it will put in your Applications folder to remove if you're not happy with the configuration. Enjoy.
Actually, /usr/bin/rails script is just a
# Stub rails command to load rails from Gems or print an error if not installed.
(Comment quoted from the very script's source)
If Rails is installed, then it is loaded. Else, the script will throw the error you pasted in your question.
Yet, another alternative to RVM is the awesome rbenv tool.
It is very easy to install (just a simple brew install rbenv) and work with. In my opinion, it is the best way to manage your rubies on a Mac.
However, if you have rvm installed on your machine already, consider removing it from your system by doing rvm implode.
Since setting up a fresh ruby on rails dev environment is a common barrier to most newbies (including myself when i started off with rails) I've put together detailed instructions on how to do exactly that in a blog post, which i will link to below. Hope you will find it useful.
http://blog.parsalabs.com/blog/2013/08/27/setting-up-a-ruby-on-rails-4-development-environment-on-a-clean-mac-os-x-installation/
i got the same error and uninstall rvm then i follow the instructions on this page https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm
i think that help was
rvm requirements
on the terminal.
Our company uses a script to setup each new machine with a Rails dev environment:
We've open source it, give it a try: https://github.com/platform45/let-there-be-light
After a new
gem install rails
do
rbenv rehash
It worked for me.
I've tried the following commands:
rvm system gem install rails
rvm system install rails
rvmsudo gem install rails
sudo gem install rails
After one of these commands, I get a message telling me to run sudo gem install rails. But it doesn't work.
I had no problems before to install rails on rvm 1.9.2 the Mac OSX 10.6.8 version.
Could anyone help me with that?
If you've installed rvm successfully, test with rvm info so that it returns output then you just need to do gem install rails to install rails into the ruby version you are using with RVM - no sudo required. Have I misunderstood?
First check either rvm install properly or not using this command
rvm --help
then install rails by this command
gem install rails -v=3.2.1
Or any version you want..
If you don't have ruby 1.9.3 then use:
$ rvm install 1.9.3
or you may start from this:
$ rvm use 1.9.3
$ rvm gemset create rails313
$ rvm use 1.9.3#rails313 --default
$ gem install rails -v 3.1.3
note: I use 1.9.3 as an example you can use other ruby version also.
Follow the documentation. Make sure you've got the necessary system requirements via rvm requirements. Unless you've got some bizarre user permissions in $HOME, there is no reason to use sudo w/ rvm on your system.
make sure you have installed build_essentials, also try rvm requirements, which gives all dependencies, install all using rvmsudo command
See also: Installing Ruby on Rails - Mac OS Lion
First check whether all dependencies are satisfied by running:
$ rvm requirements
next:
$ rvm install ruby
next:
$ gem install rails
Note: You may have to use sudo or rvmsudo before the commands depending on whether its system-wide install or user specific.
I'm running into issues trying to install Rails on OS X Lion using RVM.
So far, I have done the following:
Installed Mac OS X Lion Version 10.7 (Build 11A459e).
Installed XCode 4.1 Developer Preview 5.
Installed RVM.
Installed a 1.8.7 version of Ruby via RVM using the command rvm install 1.8.7. Note: I need to be using 1.8.7 and not 1.9.2.
Switched to the 1.8.7 version of Ruby using the command rvm 1.8.7.
Created a new gemset using the command rvm gemset create rails3.
Switched to the new gemset using the command rvm use 1.8.7#rails3.
To install Rails I ran the command gem install rails but I got the following error:
/Users/m/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
The same error happens when trying to run any gem command so I don't think it's really a problem with Rails.
Judging by the links below, I don't seem to be the only person having this issue:
http://twitter.com/#!/pingles/status/66261101351927809
and https://github.com/carlhuda/bundler/issues/1058
Fixed it!
The answer was actually on one of the links I posted above. Before installing a version of ruby (rvm install 1.8.7) I needed to run "export CC=/usr/bin/gcc-4.2". With that in place, everything ran smoothly.
If you don't want to have CC permanently exported, you can do CC=/usr/bin/gcc-4.2 rvm install 1.8.7
If you have already installed ruby 1.8.7. Just do CC=/usr/bin/gcc-4.2 rvm reinstall 1.8.7
If you have installed Xcode 4.2, it actually doesn't install non-LLVM gcc anymore, so you have to add it. For some reason downgrading to 4.1 after you've installed 4.2 doesn't work correctly (at least it didn't for me and others have had similar issues).
After quite a bit of thrashing, this is what finally worked for me:
Install Xcode 4.2 from App Store
Install darwin gcc using the OSX gcc installer
Install REE making sure you remove any vestiges of previous attempts:
Close any open terminal windows, open a fresh one and
rvm remove ree
export CC=/usr/bin/gcc-4.2
rvm install ree
This worked for me with rvm 1.8.6, OS X 10.7.2 and gcc-4.2 version 4.2.1 (Apple build 5666).
If you have already installed Xcode 4.1, resist the urge to upgrade to 4.2 and you should be okay.
If that still doesn't work add --force.
So this becomes:
CC=/usr/bin/gcc-4.2 rvm install ruby-1.8.7 --force
Make sure that you remove 1.8.7 if you already installed it before using "export CC=/usr/bin/gcc-4.2" by doing "rvm remove 1.8.7"
I had the same issue on my system. I installed the Xcode command line tools from Apple which ships with LLVM compiler and without an LLVM free one.
Ruby 1.8.7 won't work with an LLVM compiler not even with CC=clang, so installing an LLVM free gcc solves the problem.
There are multiple options listed here:
https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
Long story short, install GCC v4.2 with Homebrew:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
and then install ruby 1.8.7:
CC=gcc-4.2 rvm install 1.8.7
Instead of "export CC=/usr/bin/gcc-4.2" do "export CC=gcc" (xCode 4.2.x should be installed).
Check which version of gcc you have like this:
ls -Al `which gcc-4.2`
I followed the instructions here:
http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion
brew update
brew tap homebrew/dupes
brew install apple-gcc42
Then reinstall:
Check again what your path to gcc is (to use for CC=):
ls -Al `which gcc-4.2`
(optional) You can set this in your .bashrc for example:
export CC=/usr/bin/gcc-4.2
(optional) remove any old version of ruby
rvm remove 1.8.7
Then:
CC=/usr/local/bin/gcc-4.2 rvm --verify-downloads 1 reinstall 1.8.7-p357 --without-tcl --without-tk
or if you have set CC in your profile
rvm --verify-downloads 1 reinstall 1.8.7-p357 --without-tcl --without-tk
Note the flags on the rvm install. I had trouble verifying the checksum on the ftp server and some problems with tck and what not. You may be able to omit those flags.
Also: you might need to remove an old version of your gemset:
rvm gemset delete <gemset>
Then
gem install bundler
bundle install
Hope this helps.
Using macport and ruby-1.9.x version.
I did successfully install rails with ruby gem.
I have same problem only for arch x86_64, when I comment line in my ~/.rvmrc
rvm_archflags="-arch x86_64"
Open a new terminal and tried to install ruby-1.8.7 again
rvm install 1.8.7
It was successful.
If you're using RVM in a development workflow, I added a fix in an .rvmrc file for OS X Lion.
https://gist.github.com/1112962
(updated file name)
This is not related to RVM, but if what you are looking for is a local development environment for Lion you may want to give a try to RubyStack It is a free, open source all-in-one installer for Apache, MySQL, Ruby, Rails, etc. It does not require compilation and it is self-contained so if you do not like it you can simply remove the installation directory and you are done. Disclaimer: I'm one of the RubyStack developers :)
CC=/usr/bin/gcc-4.2 rvm install 1.8.7 did not work for me, I used CC=/usr/bin/gcc rvm install 1.8.7 and it did (checking with "which gcc")
Even with all the other suggestions on this page I was still getting segfaults and getting frustrated, so I said "screw it!" and use the system-provided Ruby 1.8.7:
rvm use system
You need to use sudo for installing gems, but still waay less headache.
My solution was to override the /usr/bin/gcc symlink in the terminal. Here's how I did it:
https://plus.google.com/101970693023462019144/posts/eYVLvMCqTmc
This not only fixed my RVM installation, but also made sure that installing gems with native extensions (like rmagick) work.