I am trying to install rails on Ubuntu 10.04. So far, I've executed these commands:
apt-get install build-essential libapache2-mod-passenger apache2 rubygems ruby1.8-dev libopenssl-ruby
gem install fastthread
gem install rails
Fastthread installed easily. However, trying to install rails results in:
ERROR: Error installing rails:
bundler requires RubyGems version >= 1.3.6
So, I tried gem -v which returned 1.3.5.
How do I upgrade rubygems? apt-get won't install above 1.3.5. And gem update --system results in:
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
So right now I simply can't install rails, because I need a newer version of rubygems, and ubuntu won't let me upgrade my current version of rubygems.
As a side note, i tried installed rails via apt-get install rails which seemed to work, but I don't see rails as a gem when i type gem list. What's the deal with that?
Another note: The result of gem list is:
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.1, 3.0.0)
actionpack (3.0.1, 3.0.0)
activemodel (3.0.1, 3.0.0)
activerecord (3.0.1, 3.0.0)
activeresource (3.0.1, 3.0.0)
activesupport (3.0.1, 3.0.0)
arel (2.0.1, 1.0.1)
builder (2.1.2)
erubis (2.6.6)
fastthread (1.0.7)
i18n (0.4.2)
mail (2.2.9)
mime-types (1.16)
mysql (2.8.1)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
railties (3.0.1, 3.0.0)
rake (0.8.7)
rubygems-update (1.3.7)
thor (0.14.4)
treetop (1.4.8)
tzinfo (0.3.23)
I assume installing rails via apt-get installed those gems? Prior to installing rails through apt-get I only had mysql and fastthread.
There is also a gem available which handles the update
sudo gem install rubygems-update
sudo /var/lib/gems/1.8/bin/update_rubygems
You have to manually install rubygems 1.3.7 (wget from website, extract, run setup.rb).
Install rvm and take control of your ruby environment.
http://rvm.io/
This may be a newer way of doing it that wasn't available before, but I ran
sudo gem update --system
and it gave me the latest version.
For some reason, Debian/Ubuntu Ruby package doesn't include the RubyGems library. Even worst, RubyGems has been bundled into Ruby 1.9.x but if you try to install it via apt-get, the package manager will force you to install them as two separate packages.
Debian/Ubuntu RubyGems package is outdated, as you noticed, and to make things even more complicated you can't upgrade the packaged version of RubyGems just installing a new RubyGems versions on top of it because the system is patched to prevent you to complete the task, as you experienced.
My suggestion is to avoid using the Ubuntu/Debian pckaged version.
The alternatives are:
for a development system, use RVM
for a production server, install Ruby from source. If you want Ruby < 1.9 you can use Ruby Enterprise edition that is also available as Debian/Ubuntu package. If you want Ruby 1.9.x, compile it from the source.
Related
We had a server shutdown and Redmine stopped working, so I had to reinstall Bundler and run bundle install.
While running bundle install I get this error:
c:\APPS\webapps\redmine-3.2.0>bundle install
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Using rake 12.3.2
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Using json 1.8.6
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 4.2.5
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.4.0
Fetching nokogiri 1.9.1 (x64-mingw32)
Installing nokogiri 1.9.1 (x64-mingw32)
Gem::RuntimeRequirementNotMetError: nokogiri requires Ruby version >= 2.2, <
2.6. The current ruby version is 2.0.0.
An error occurred while installing nokogiri (1.9.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.9.1' --source
'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rails was resolved to 4.2.5, which depends on
actionmailer was resolved to 4.2.5, which depends on
actionpack was resolved to 4.2.5, which depends on
actionview was resolved to 4.2.5, which depends on
rails-dom-testing was resolved to 1.0.9, which depends on
nokogiri
I already installed Nokogiri 1.6.8. I'm not sure why it cannot read the Nokogiri version that I installed and still fetches 1.9.1 because I need Ruby v. 2 for Redmine 2.3.0, however my bundle is still telling me that it is looking for 1.9.1. While doing bundle install I tried changing the Gemfile based on my research to gem "nokogiri", ">= 1.4.2" however 1.9.1 is persisting. How can I successfully upgrade Nokogiri?
I used:
gem "nokogiri", "1.6.8"
In my Gemfile I have:
c:\APPS\webapps\redmine-3.2.0>bundle update nokogiri
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Bundler could not find compatible versions for gem "nokogiri":
In Gemfile:
nokogiri (= 1.6.8) java
roadie-rails java was resolved to 1.2.0, which depends on
roadie (~> 3.1) java was resolved to 3.5.0, which depends on
nokogiri (~> 1.8) java
If I run what gem install nokogiri -v '1.9.1', I get an error that my Ruby version is lower than expected and I cannot have a higher Ruby version because Redmine is an old version.
Here are all the Nokogiri versions I have:
c:\APPS\webapps\redmine-3.2.0>gem uninstall nokogiri
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
Select gem to uninstall:
1. nokogiri-1.6.8.rc3-x64-mingw32
2. nokogiri-1.6.8-x64-mingw32
3. nokogiri-1.6.8.1-x64-mingw32
4. All versions
I could not fix this issue. It was looping through upgrades and downgrades, so after much frustration I tried Ruby 2.6 that Redmine 4.2 claimed to be compatible, which still had issues. I downgraded to Ruby 2.3 and it worked, then I migrated my database according to the redmine.org documentation and almost everything is functional, and I got a feedback that it is much faster.
According to my experience, you will have your Redmine database still working so don't worry that it s the same version.
I'm using the Unity 5.2.4f game development engine and I have installed Ruby 1.9.3 on my old Mac with a Mac OS X v10.7.5 (Lion) system on it.
When I open a Unity project for the first time, there is an installation attempt which is failing and I don't know how to solve this, after trying for a few days. Here is the error I get:
IOS RESOLVER
Failed to install Cocoapods for the current user.
It will not be possible to install Cocoapods in the generated Xcode project which will result in link errors when building your application.
For more information see:
https://guides.cocoapods.org/using/getting-started.html
'gem install activesupport -v 4.2.6 --user-install' failed with code (1):
WARNING: You don't have /Users/DAN26/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
ERROR: Error installing activesupport:
i18n requires Ruby version >= 1.9.3.
So I go to the Terminal and do the following:
export PATH="/Users/DAN26/.gem/ruby/1.9.3/bin:$PATH"
No change. So I do this:
export PATH="/Users/DAN26/.gem/ruby/1.8/bin:$PATH"
Still get the same message...
Enter
$PATH
Result:
-bash: /usr/local/opt/openssl/bin:/Users/DAN26/.rbenv/bin:/Users/DAN26/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/DAN26/.rvm/bin: No such file or directory
I have installed lower versions of activesupport 4.2.5 and cocoapods 0.34.4 but no change (I have installed them because any other versions require Ruby 2.0.0+ which I fail to install)
Also if I enter in the Terminal:
gem list
I get this:
*** LOCAL GEMS ***
activesupport (4.2.9, 4.2.6, 4.2.5, 3.2.22.5)
bigdecimal (1.1.0)
claide (0.7.0)
cocoapods (0.34.4)
cocoapods-core (0.34.4)
cocoapods-downloader (0.7.2)
cocoapods-plugins (0.3.2)
cocoapods-trunk (0.3.1)
cocoapods-try (0.4.5)
colored (1.2)
escape (0.0.4)
fuzzy_match (2.0.4)
i18n (0.8.6)
io-console (0.3)
json (1.8.6, 1.5.5)
json_pure (1.8.6)
minitest (5.10.3, 2.5.1)
multi_json (1.12.1)
nap (1.1.0, 0.8.0)
netrc (0.7.8)
open4 (1.3.4)
rake (0.9.2.2)
rdoc (3.9.5)
thread_safe (0.3.6)
tzinfo (1.2.3)
xcodeproj (0.19.4)
I don't have any understanding on Mac. All I did above was by tutorials.
You can use sudo gem install cocoapods for installing CocoaPods in an old mac. It will be asking for the administrator password.
Based on the upcoming error, do the below steps:
sudo gem install activesupport -v 4.2.6
sudo gem install cocoapods
It can be possible you have to check activesupport version with this link.
I don't know what's going on with my installation of ruby / rails under OSX Mountain Lion.
I start with a black rails application, run bundle and listing the installed bundles with bundle show I get this:
[..]
* sqlite3 (1.3.7)
* thor (0.17.0)
* tilt (1.3.3)
* treetop (1.4.12)
[..]
As soon as I run rake db:migrate I get the following error:
Could not find thor-0.17.0 in any of the sources
Run `bundle install` to install missing gems.
But, as shown, thor-0.17 is installed. If I force it:
sudo gem install --version 0.17 thor
Successfully installed thor-0.17.0
1 gem installed
Installing ri documentation for thor-0.17.0...
Installing RDoc documentation for thor-0.17.0...
And run the migration again, I keep having dependency errors (in this case "Could not find formtastic-2.2.1 in any of the sources") for gems that bundle says are already installed. Any help? Thanks
EDIT
Gemfile: http://pastebin.com/WSz5dLrm
Gemfile.lock: http://pastebin.com/2kuFz1kK
So after using your Gemfile I got the following error :
Bundler could not find compatible versions for gem "railties": In
Gemfile:
rails (= 3.2.8) ruby depends on
railties (= 3.2.8) ruby
sass-rails (~> 3.2.3) ruby depends on
railties (3.2.11)
Bundler could not find compatible versions for gem "actionpack": In
snapshot (Gemfile.lock):
actionpack (3.2.11)
In Gemfile:
meta_search (>= 1.1.0.pre) ruby depends on
actionpack (~> 3.1.0.alpha) ruby
Running bundle update will rebuild your snapshot from scratch, using
only the gems in your Gemfile, which may resolve the conflict.
Using rails with the version 3.2.11 fixed the bundle.
Rails 3.2.11 fixes a huge security threat anyway, so update !
➜ ~ rvm -v
rvm 1.10.2 by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.beginrescueend.com/]
➜ ~ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
➜ ~ rails -v
/Users/hb/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/hb/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/hb/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:1208:in `gem'
from /Users/hb/.rvm/gems/ruby-1.9.3-p0/bin/rails:18:in `<main>'
➜ ~
I installed a clean installation of ruby just now, and rails, I removed all my previous gems, and I still keep getting this error. Any ideas ? And yes, I had this error before, and this is what I did
A little more info:
➜ ~ gem list
*** LOCAL GEMS ***
actionmailer (3.2.1)
actionpack (3.2.1)
activemodel (3.2.1)
activerecord (3.2.1)
activeresource (3.2.1)
activesupport (3.2.1)
arel (3.0.0)
builder (3.0.0)
bundler (1.0.22 ruby)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.1)
json (1.6.5)
mail (2.4.1)
mime-types (1.17.2)
multi_json (1.0.4)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.1)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.1)
railties (3.2.1)
rake (0.9.2.2, 0.9.2)
rdoc (3.12)
sprockets (2.3.0, 2.1.2)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.31)
➜ ~ gem install rails
Successfully installed rails-3.2.1
1 gem installed
Installing ri documentation for rails-3.2.1...
Installing RDoc documentation for rails-3.2.1...
➜ ~ rails -v
/Users/hb/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/hb/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/hb/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:1208:in `gem'
from /Users/hb/.rvm/gems/ruby-1.9.3-p0/bin/rails:18:in `<main>'
➜ ~
It means your Rails installation is corrupted or incomplete. If you list your gems, chances are you won't find railties
$ gem list
Run the command
$ gem install rails
again. It will download and install missing dependencies, including railties.
I ran into the same problem and, in my case, it turned out to be because I had installed using sudo - it does not necessarily make rails available to ordinary users. Try running just gem install rails if you previously ran sudo gem install rails.
Worked for me
rvm reinstall 1.9.3
then
gem install rails
I ran into this same issue. If you're using RVM it's possible you switched to the wrong Ruby version which causes a gem load error if the directory uses a different version than the one you are currently set to use.
To fix, type rvm use -yourrubyversion in the app's directory in terminal. For example, if your app is set up to use ruby 1.9.3 type rvm use -1.9.3.
RVM works by separating your gems by ruby version by app, so if you switch to a different ruby version RVM will separate previously used and installed gems from the different ruby version, which is why you may be seeing tho issue.
rvm implode was the answer. Something probably went wrong before, now everything works after a rvm reinstall.
Maybe you installed two or more version of rails and railties.
gem uninstall railties
gem uninstall rails
then reinstall.
I got the same error when I installed ruby 1.9.3p194
and then I reinstalled ruby and rails
Simone's answer is great. However, if you already have your Rails gem in your Gemfile, just try to use bundle exec instead:
bundle exec rails c
And that should suffice. If not, then add
bundle install
before the mentioned command.
I also had this issue after I installed ZSH (Wanted to mess with it's templates.)
Ran
brew update
which did find some updates I wasn't missing before, but in the end
gem install rails
suddenly completely re-installing the rail/ties system. Unsure why ZSH removed it.
Uninstalling ruby, and railsinstaller and then installing railsinstaller again worked great for me!
I did 'gem install rails' on my system (ubuntu) and it installed the missing gems approx 28 of them then i did 'gem list' to check and it was all there.
I am trying to get a basic Rails application to run on my Mac OS X 10.6.5. I created a new app called demo (rails new demo), then went into the demo directory and tried to start the app with rails server.
Here is the error message I received:
"/Users/dpetrovi/.gem/ruby/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10]
Abort trap"
I checked bundle install in the demo folder:
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.3)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.3)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.6)
Using tzinfo (0.3.23)
Using actionpack (3.0.3)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.13)
Using actionmailer (3.0.3)
Using arel (2.0.6)
Using activerecord (3.0.3)
Using activeresource (3.0.3)
Using bundler (1.0.7)
Using thor (0.14.6)
Using railties (3.0.3)
Using rails (3.0.3)
Using sqlite3-ruby (1.3.2)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Ruby, RubyGems, and sqlite3 were installed using MacPorts. Then I used gem to try to install the sqlite3-ruby interface. (sudo gem install sqlite3-ruby). Here is where I first noticed something could be off:
Successfully installed sqlite3-ruby-1.3.2
1 gem installed
Installing ri documentation for sqlite3-ruby-1.3.2...
No definition for libversion
Enclosing class/module 'mSqlite3' for class Statement not known
Installing RDoc documentation for sqlite3-ruby-1.3.2...
No definition for libversion
Enclosing class/module 'mSqlite3' for class Statement not known
I had rails running well on my system a few months ago, so I figured maybe I had some duplicates and it was trying to use the wrong one. I ran: for cmd in ruby irb gem rake; do which $cmd; done and got:
/opt/local/bin/ruby
/opt/local/bin/irb
/opt/local/bin/gem
/opt/local/bin/rake
Checking where sqlite3 also gets me: "/opt/local/bin/sqlite3" so they all seem to be in the right place. Obviously /opt/local/bin is in my system path.
If I check gems server, it shows that I have installed sqlite3-ruby 1.3.2 gem. Not sure what the problem could be?
I am using ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10]. Macports claims this is the latest (although ive seen 1.9.1)
One more thing-- in irb, I tried to check which version of sqlite3 my sqlite3-ruby is bound to, but I can only get this far:
:irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'sqlite3'
/Users/dpetrovi/.gem/ruby/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10]
Abort trap
Any suggestions? Im hoping I overlooked something obvious. Thanks
Have you upgraded to Snow Leopard recently? If so, you need to reinstall MacPorts and all the ports installed with it.
I recommend using RVM instead MacPorts installed ruby.
Definitely use RVM as mentioned above and then try this in your app's directory:
rm -rf .bundle && bundle install
i had the same problem. here is how i resolved it.
removed the gem sqlite3-ruby
did bundle install
reinstalled the gem
recreated the rails app
now webrick works fine.