I tried to install the new beta on my system with the command:
sudo gem install rails --pre
but no matter what I tried, I still get this damn error:
Successfully installed
rails-3.0.0.beta3 1 gem
installed Installing ri
documentation for
rails-3.0.0.beta3... File not
found: lib
Since I'm very new to ruby, I really don't know what to do.
How can I finish installing this?
Is this installed already?
Why does it abort here?
All you need to run is gem install rdoc, follow its instructions, then run the install rails command again and you're good. The problem is due to rdoc failing to install when installed with rails, if installed manually it works fine.
Source: http://gist.github.com/565967
^ I had the same problem, and this worked for me.
If you're looking to do ruby/rails development on Mac, I'd strongly recommend not using the version of ruby/rubygems shipped with your mac. What I do recommend is:
Installing homebrew and using that to manage software packages on your mac.
Install brewbygems, which makes homebrew play nice with rubygems: gem install brewbygems
Install rvm and learn to love the different versions of ruby and rvm's gemsets feature: gem install rvm
Once you've done that you'll have a pretty robust development environment and you should be able to install any version of rails without a problem. Just keep in mind rails 3 works best using ruby 1.9.2 (install with rvm by running rvm install ruby-head) and is still in beta, meaning it isn't terribly stable and should not be used for anything production grade (yet).
I found the same error message, while after some google I've successfully installed it by manually 'sudo mkdir lib' in the .../gems/rails-3.0.0.beta3. Though it hasn't raised further problem, I hope someone could tell what should be in the missing lib directory.
You don't really need to do this sudo gem install rails --pre, simply sudo gem install rails. Rails3 is the default package now and out of beta.
It should work fine.
Might be a different solution on your OS, but I got the same exact error in Ubuntu and creating a ¨lib¨ folder under the rails gem folder solved my problem. I have explained the solution in the following post:
Installing Rails: "File not found: lib"
For convenience I will copy it here as well. The solution:
mkdir /lib/ruby/gems/1.8/gems/rails-{whatever your version is}/lib
Explanation: The ¨[sudo] gem install rails¨ command expects the /lib folder (at the end) but for some reason it hasn´t been created yet.
The original source of this solution was the following URL. Hope it helps!
http://www.spritle.com/blogs/?p=915
Same problem with beta 4.
The workaround is sudo gem install rails --pre --no-ri --no-rdoc though I don't know why.
Related
I'm very new to RoR specially on Mac. I have installed it many times on Ubuntu with RVM and I'm very comfortable with that. Here is what happened on Mac:
I went through instructions as explained here http://goo.gl/zsHcCC then when I got to the point to install Rails with " gem install rails " I got this error:
Error installing rails:
ERROR: Failed to build gem native extension.
Now I want to roll-back everything and uninstall rbenv and it's ruby versions and reinstall the Ruby On Rails environment using RVM.
I tried to find how to uninstall Homebrew, RBENV and Ruby, but no success.
Thank you.
Sia
Homebrew or Rbenv are very good tools to have as a dev, I would think twice before removing either.
In this case I doubt they are at fault.
Can you confirm you have installed the GCC command line utils for OSX by running $ xcode-select --install in your terminal.
Here is a useful post explaining that process but I find that command generally works fine for me.
If this succeeds what does your $ gem install rails output next?
If you are very new you and you don't need specially the last version of Ruby. You can use Rails Installer http://railsinstaller.org/fr-FR.
To uninstall brew https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md
I am trying to install Rails on my Mac Version 10.9.5 and something is not working as when I try to see which version of Rails I have installed I get the following:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
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.
If I try to run that command, this is what I am getting...
sudo gem install rails
Password:
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
Referenced from: /Users/ppmartins/.rvm/rubies/ruby-2.1.3/bin/ruby
Reason: image not found
Any idea about what's happening and how to solve this issue?
Thank you all.
It is best to never use your system Ruby to install Gems. System Ruby is a version of Ruby that ships with your Mac. OSX uses Ruby for various tasks, so it is best to leave it alone and not risk corrupting any Gems.
Instead, you should use Ruby version managers to install versions of Ruby that your system won't rely on. Using sudo is also not necessary for these versions. If you find yourself needing to do this, you might be (ab)using your system Ruby.
Personally I use rbenv since it integrates well with Homebrew, but there are others such RVM as well.
Try following http://installrails.com/
It runs you step by step through setting up an environment on your computer. :D
It's pretty straight forward compared with googling rbenv, RVM etc
Hope this helps!
Dump rvm and use rbenv. You haven't set it up correctly anyway
Don't use sudo when installing gems
Make sure your don't use system Ruby from '/Library'
So,
Install Homebrew http://brew.sh
Install Rbenv brew install rbenv
Install Ruby Build brew install ruby-build
Install Ruby rbenv install 2.1.2
Make it a default interpreter rbenv global 2.1.2
That's the gist of it. There might be some things you need to do manually like adding rbenv path to your .bash_profile.
Update I was downvoted? Haha, why?
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 am trying to build ROR application for which I wrote rails fist_app command in terminal. I didn't find gemfile in folder fist_app. When goggled, found Stackoverflow answer for this problem which suggest to update rails.
But when I update rails version it shows nothing to update. Here is a screen-shot.
Please suggest some solution for this problem. Thanks
You have rails installed as Ubuntu package, not as a gem, so you can't update it. Uninstall the rails package (sudo apt-get remove rails) and then install it again as a gem: gem install rails.
UPDATE: I'm not 100% sure it will work though, because gem is also installed as Ubuntu package. It's better to set up everything (ruby, gem and rails) through RVM. Here's a tutorial: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
I just purchased my first Mac, a 13" Air with Lion, and am coming from Linux. I'm installed RVM and my first Ruby (1.8.6), but I can't get a gem to install. Here's the input:
Ryan's Air :sudo gem install rails --version 2.0.2
Password:********
and the result:
/usr/local/rvm/rubies/ruby-1.8.6-p420/lib/ruby/1.8/timeout.rb:59: [BUG] Bus Error
ruby 1.8.6 (2010-09-02) [i686-darwin11.2.0]
Ryan's Air :
Thanks in advance for any help on this.
Ryan
The issue is with Lion, and I've encountered this myself on now 2 brand-new 13-inch MBP's.
What you need to do is install the OSX GCC Compilers separately.
They can be found here: https://github.com/kennethreitz/osx-gcc-installer (scroll down to downloading pre-build binaries)
After downloading and running through the package installer (you should not need to install Homebrew), you need to find where the GCC folder is located. For some people, it was in /usr/bin; however, for me I found it in /Developer/usr/bin
Add this directory to your $PATH variable in your ~/.profile or ~/.bash_profile file. For me, I'm using ~/.bash_profile and added it to the end using vim.
Close your Terminal and open it again, and then echo $PATH to make sure the changes saved.
Completely uninstall that version of ruby, and install again normally:
rvm install 1.8.7
rvm use 1.8.7
If it still doesn't work, I recommend installing your version of rails using the following command as Hans specified in Why can't I install Rails on Lion using RVM?:
CC=/usr/bin/gcc-4.2 rvm install ruby-1.8.7 --force
the CC directory would change based on where your install was. However, after adding the correct path to gcc to my $PATH variable, I did not need to do the above command.
If you were still having this problem, hope this helps.
Look at this article. It seems that you get deadlocks with your combination of old rails, sqlite and Webrick. Michael is right, try to use modern version of rails.
rvm install 1.8.7-head
This worked for me, everything else failed. I did not install the gcc specifically, just clean Xcode 4.2