Um quite new to rails and um getting an error when run the command
rails s
it says
Could not find rake-0.9.2.2 in any of the sources
Run bundle install to install missing gems.
when I run bundle install nothing happened
my gem list has rake 0.9.2.2
what can go wrong?
my ruby version is 1.9.3
Thank you in advance
Remove all the versions of Rake ==> gem uninstall rake
Remove your gemfile.lock => rm Gemfile.lock
Remove gem 'rake' on your gemfile
Run bundle install
Install Rake manually : gem install rake --version=10.0.4
When you use command gem list, you will get a list of gem installed on your machine.
For example : rake (10.0.4, 10.0.3, 0.9.2.2)
Just see the console which gem is compatible with your application. It is already mentioned in the error log message.
Use
gem uninstall rake
Keep the suitable one and remove the version who is creating trouble. And then run rails s or bundle exec rails s
Try using rvm and go back to ruby 1.8.7 instead of 1.9.2. This fixed it for me. Don't forget to install rails again (sudo gem install rails while already on 1.8.7) if you have only installed rails for 1.9.3.]
Related
I've replaced the gem mysql2 for a sqlite3 in development environment. However Rails keeps looking for it. I've tried to delete Gemfile.lock and it didn't work. I've also changed the database.yml file.
This is the error when I do rails db:create
LoadError: cannot load such file -- /home/gn09/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/arel-9.0.0/lib/arel/visitors/mysql.rb
replace gem in Gemfile
#gemfile.rb
gem 'sqlite3'
database.yml
something like this
bundle
bundle update - update Gemfile.lock correctly
rails db:create db:migrate
rails s
First uninstall ruby
rbenv uninstall 2.6.1
Then install again to get a fresh set of gems
rbenv uninstall 2.6.1
Then install bundler
gem install bunder -v '2.1.4'
Then
bundle install
I built a new clean VM, install rvm, and installed ruby 1.9.2 and ran gem install rails --version '=3.0.7'. So far so good. When I did gem list rake, I saw that rake 0.9.2.2 was installed and I need rake 0.8.7. I read up on uninstalling rake. Then installed gem install rake -v='0.8.7'. This is what I did and observed:
gem list rake
rake (0.9.2.2, 0.8.7)
gem uninstall rake 0.9.2.2
You have requested to uninstall the gem rake-0.8.7
.......
Continue [Yn]
Successfully unistalled rake 0.8.7
INFO: gem "0.9.2.2" is not installed
gem list rake
rake (0.9.2.2)
Ok so it shows both versons of rake installed at first, I specify to delete 0.9.2.2 and it says its uninstalling 0.8.7 and that it completed uninstalling 0.8.7. (Not what I entered) At the end it shows 0.9.2.2 still installed in gem list rake. I have gone through this iteration multiple times, same result every time.
In the end, I need Ruby 1.9.2; rails 3.0.7 and rake 0.8.7. The first two I have fine. But how do I get rake back to 0.8.7? Or is what I see just some trash left over in some inventory of gems and does not reflect reality? or can you be sure what you really have?
Thanks in advance.
Try using the following command
rvm use #global && gem uninstall rake
I was having this same issue with the predefined constatnts 'Ruby' & 'LN_SUPPORTED'.
However; my 'gem list' only was showing rake 0.9.2.2. So after I was able to install 0.8.7, everything started working again.
sudo gem install rake -v=0.8.7
Can you do a: sudo gem uninstall Rake without specifying a version to get rid of rake completely before trying to reinstall both versions? Or possibly (I know it's frowned upon, but... ) remove the rake gem folder?
Also, maybe you could add rake (0.9.2.2, 0.8.7) to your gemfile and then do a bundle update
This works for me:
gem uninstall rake --version 0.9.2.2
I am following this backbone rails turotial.
The tutorial says they are using Ruby 1.9.2 and rails 3.0.3.
I am using Ruby 1.9.3, and I created an rvm gemset for this tutorial and installed rails 3.0.3 into the gemset.
I ran bundle install which installed mysql2 version 0.3.11
When I ran rake db:create I got this error:
WARNING: This version of mysql2 (0.3.11) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1
WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x
So I ran:
gem uninstall mysql2
gem install mysql --version 0.2
rake db:create
Then I got this error:
Could not find mysql2-0.3.11 in any of the sources
Try running bundle install.
If I run bundle install it takes me back to the first problem.
Not sure what the I should try next.
place in Gemfile
gem 'mysql2','0.2.7'
then run
bundle install
I am having some trouble removing the rake gem version 0.9. I managed to run gem uninstall rake and I believed this to have deleted it. However, going back to gem list it still showed that it still exists.
Running gem env:
GEM PATHS:
/home/sean/.rvm/gems/ruby-1.9.2-p180
/home/sean/.rvm/gems/ruby-1.9.2-p180#global
I went into the #global directory and manually deleted it there, yet still it remains somewhere. I can see it when I run gem list. The 0.9 rake gem is causing problems for my Rails 3.0.7 application.
I ran gem list -d rake:
rake (0.9.0, 0.8.7)
Installed at
(0.9.0): /home/sean/.rvm/gems/ruby-1.9.2-p180#global
(0.8.7): /home/sean/.rvm/gems/ruby-1.9.2-p180
I don't see anything in the gems directory for ruby-1.9.2-p180#global
You should run
rvm use #global && gem uninstall rake -v 0.9.0
rvm use # && gem uninstall rake -v 0.9.0
to correctly remove rake 0.9.0 from rvm
In terminal type in: gem uninstall rake, then select version 0.9.0 when prompted.
Then modify your Gemfile within your Rails application:
gem 'rake', '0.8.7'
Then in terminal run:
bundle install
These steps should fix the problems you are having. Upgrade to rake again when you upgrade to rails 3.1.
If you're using rvm you get rake 0.9 installed "for free" in the global gemset which makes it hard (impossible?) to uninstall properly. gem uninstall rake is successful but doesn't actually remove rake 0.9. I had to do it manually for both REE and 1.9.2.
I edited the rake executable script (find with which rake) and added a:
puts "Gem.bin_path: #{Gem.bin_path('rake', 'rake', version)}
...before the last line. This prints (on my system):
Gem.bin_path: ~/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.9.0/bin/rake
To remove 0.9 cd into ~/.rvm/gems/ree-1.8.7-2011.03 and manually delete all rake-0.9 files (gems, specifications are the ones that count I believe).
I ran into this same problem (needed rake 0.8.7 but got 0.9.0 "for free" with rvm). Initially gem list -d rake gave the following output:
rake (0.9.0, 0.8.7)
Installed at (0.9.0): ~/.rvm/gems/ruby-1.9.2-p136#global
(0.8.7): ~/.rvm/gems/ruby-1.9.2-p136#my_gemset
Switching to the global gemset with rvm use #global gave me this output:
rake (0.9.0)
Installed at: ~/.rvm/gems/ruby-1.9.2-p136#global
So I just did gem uninstall rake. Now, switching back to my gemset with rvm use #my_gemset the correct version of rake (0.8.7) is being used.
If you're using bundler, you should read this excellent article by Yehuda Katz. Following his instructions means you don't have to uninstall rake 0.9.0. Try following command:
bundle exec rake --version
Prepending bundle exec will make sure that only the correct version of the rake is loaded, regardless of others you have installed.
Did you try using the 'gem cleanup' script ?
I am trying to run Rails3 on XP Profesoinal and following the tutorial here http://railstutorial.org and am receiving the following errors all the time, even trying to return static pages. The message is the procedure entry point rb_str2cstr could not be located in the dynamic link library msvcrt-ruby191.dll
Also, the page gives a runtime error "no driver for sqlite3 found" even though i haven't created any models yet. The sqlite3.exe, sqlite3.dll and sqlite3.def are all in the bin folder and I have run Gem install sqlite3-ruby.
I have also tried gem install mongrel --pre and the instructions given http://www.ruby-forum.com/topic/202770#882858, but nothing is working
Here is my minimal fix for the problem:
ruby -v => 1.9.2p0
rails -v => 3.0.0
gem -v => 1.3.7
download sqlitedll-3_7_3.zip from http://sqlite.org/download.html
copy sqlite3.def and sqlite3.dll to ruby/bin
edit Gemfile:
gem 'sqlite3-ruby', '1.3.1', :require => 'sqlite3'
del Gemfile.lock
bundle install
rake db:migrate
Ruby 1.9.2, Rails 3.0
rake db:migrate produces the error message:
The procedure entry point rb_str2cstr could not be located in the dynamic link library msvcrt-ruby191.dll
Resolved by the following:
Delete gemlock.
Change SQLite version to 1.3.1.
Run: bundle install.
rake db:migrate now produces the correct results.
My versions:
ruby -v => 1.9.2p0
rails -v => 3.0.0
gem -v => 1.3.7
Gemfile:
gem 'sqlite3-ruby', :require => 'sqlite3'
Then:
Deleted Gemfile.lock
rake db:migrate
This fixed the error that you mentioned (The same windows pop-up).
Metoo. I was trying to run rake db:migrate on Vista-64. (same book).
Follow-up: I had been trying to solve some other problem by uninstalling and re-installing things and probably messed things up. When I ran into this problem no amount of 'gem uninstall' or 'bundle install's would solve it. Until I removed my Gemfile.lock and did a 'Bundle install'. Then my 'rake db:migrate' ran w/o error. It didn't look like bundle installed anything since all output was 'Using xxx', but I'll take it.
for me this meant "“you need to update your sqlite3-ruby gem version somehow" http://betterlogic.com/roger/?p=3027
I had the same problem with XP Pro and the Rails tutorial. I had SQLite version 1.2.5 installed, which matched what it says in Chapter 2 of the tutorial.
But when I saw roger's comment about using version 1.3.1, I installed that version (using "gem install sqlite3-ruby -v 1.3.1"). But it gave a message about using SQLite version 3.6.23.1 with this gem, along with the relevant website. So I downloaded it and replaced the sqlite3 .exe, .dll and .def files in the C:\Ruby192\bin directory.
Then I looked in the gemfile and saw that the SQLite version was 1.2.5 (as per the tutorial). So I changed it to 1.3.1, deleted gemfile.lock, ran "bundle install" again, and after that "rake db:migrate" worked.