Backstory:
New to rails and attempting to install Passenger on a Mediatemple DV server. I am following and somewhat modifying this CentOS guide here since MT currently does not have any recommended 'how tos' regarding setting up a Rails production environment http://www.freshblurbs.com/installing-ruby-rails-3-centos-nginx.
I have fresh-ly installed gem and then ran gem install rake as root. Now, anytime I try to run
rake some_task
I get the following error
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:370:in `bin_path':
can't find gem rake ([">= 0"]) with executable rake (Gem::GemNotFoundException)
from /usr/local/bin/rake:19:in `<main>'
rake is installed here /usr/local/bin/rake
$PATH is /usr/kerberos/sbin:/usr/kerberos/bin://sbin://bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/bin:/usr/local/bin:/root/bin:/usr/bin:/usr/local/lib
output of gem which rake is /usr/local/lib/ruby/1.9.1/rake.rb
... and unfortunately that's about all I got up my sleeves. What am I missing that's causing this to bomb?
Thanks in advance!
I have the similar problem with rake, but in ruby 1.9.2.
http://betterlogic.com/roger/2010/11/ruby-1-9-2-rake-woe/
Maybe in your case it will be helpful too.
Not sure this'll help maybe it will.. maybe not..
But run a gem list first and make sure both rake and also the passenger gem show up. I think I remember seeing a similar error that was misleading trying to setup a production server recently when running:
passenger-install-apache2-module
face palmed when I realised i hadn't installed the passenger gem yet
Related
I'm having this error message come up during Capistrano deployment. It implies to me that something's wrong with Rails being installed or something? Rails is not currently installed on the server side, but it's in my Gemfile (and my Gemfile.lock), so I'm assuming it should be installed during the bundle install command that gets executed before this line.
The actual command that's giving the error is:
bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile
I guess the problem is just that Rails is not being installed during the bundle install. Am I missing something?
Thanks!
UPDATE 1: Rails appears to be installing correctly via the bundle install command. If I check out the directory .../shared/bundle/ruby/1.9.1/gems, I can see action mailer in there.
UPDATE 2: Running the command rake assets:precompile actually fails locally as well, so this doesn't have anything to do with Capistrano it would appear. Now I just have to figure out why the config object doesn't know anything about action mailer?
UPDATE 3: Hot on the trail. It looks like my installed version of actionmailer is 0.6.1 (?!), meanwhile all the rest of my Rails stuff is up at 3.2.9. bundle update refuses to update actionmailer past this version. I'm going to remove all of my gems and start fresh.
UPDATE 4: Deleted my entire gemset using rvm gemset empty. Then tried to run bundle again, and again it tries to get actionmailer 0.6.1. I think something is screwed up with bundler or something...
The problem ended up being that I had removed a dependency upon a specific version of Rails in my Gemfile. I just had gem "rails" in there. That seemed to completely botch the dependency calculations, because it was getting super-old versions of action mailer rather than getting a consistent version from all gems. Guess it's a bad idea to not specify an exact Rails version. Yikes!
#aardvarkk,
Thanks for posting this issue, I was having the same error with my installation of Rails 4.0.0 and the error was preventing me from running my rails server
This is while I'm trying to follow the Hartl Tutorial for RoR.
I added gem "rails", '4.0.0' to my gem file and now I'm able to run my rails server.
Thank you
I'm brand new to rails and am trying to dive in to my first project on my Mac, but am running in to an issue when I run Rake -T inside my project's root dir:
Could not find rake-0.9.2.2 in any of the sources
Run 'bundle install' to install missing gems.
After I run 'bundle install' I get:
Your bundle is complete! It was installed into ./rake
But I still get the same error when I call Rake again. My gemfile lists rake as:
gem 'rake', '0.9.2.2'
If I run 'bundle list' I can see:
* rake (0.9.2.2)
I've looked at other posts on stackoverflow and google, but none of the solutions have worked for me. I'd also really appreciate any background on what's going on here, for instance, should rake be installed in to the project directory like this?
I'm not sure what else I should include to help troubleshoot?
Thank you!
Go to https://rvm.io
instal rvm, rvm install 1.9.3, rvm use 1.9.3 --default
then you can manage your gems through rvm
It is the best solution to manage your gems.
please check if rvm is configured correctly - read about .rvmrc and setup_and_load_paths.rb http://blog.ninjahideout.com/posts/the-path-to-better-rvm-and-passenger-integration, also check lines at your nginx(i suppose you use it, cause, i just had exactly same problem) configs passenger_root and passenger_ruby (this one should include smth like output of which ruby + #your_gem_set)
good luck
Have you tried Gem install rake ?
Bundle will not install anything to your path I do not think but you may also get it working by bundle exec rake. If that doesn't work, try bundle exec rake -v0.9.2.2.2
I don't fully understand how bundle works either as running Rails commands on my computer runs Rails 3.2.2 while the bundle runs Rails 3.1.1
I'm having trouble with Rails 3.2 + Spork. When I run bundle exec spork I get the error:
/usr/local/rvm/gems/ruby-1.9.2-p290#rails-3.2.1/bin/spork:19:in `load': no such file to load -- /usr/local/rvm/gems/ruby-1.9.2-p290#rails-3.2.1/gems/spork-1.0.0rc2/bin/spork (LoadError)
from /usr/local/rvm/gems/ruby-1.9.2-p290#rails-3.2.1/bin/spork:19:in `<main>'
As you might have noticed, I'm using RVM to manage my gems. Several times, I've tried reinstalling all my gems in a new gemset. I haven't had any luck. Has anyone else run into this?
I've created a Gist for of my Gemfile:
https://gist.github.com/1921929
Gist for my bundle:
https://gist.github.com/1925661
I figured it out. It was permissions related. Running bundle exec spork would give me the error that's seen above. It had occurred to me that I might need to run it as sudo bundle exec spork and when I did I received a different error.
I just ran the command as rvmsudo or rvmsudo bundle exec spork, since I'm using RVM, and it worked just fine. It turns out that this had nothing to do with Spork having any issues. Thanks everyone for taking a look.
I'm running on Rails 3.1.1 and ruby 1.9.2 on Mac OS and just started a new project where I want to use gettext for translations.
I followed every step when using fast_gettext described here: https://github.com/grosser/gettext_i18n_rails
The installation and everything works find. But when I try to rake gettext:find I get this error message:
$ bundle exec rake gettext:find
rake aborted!
undefined method `add' for "/Users/Olaf/.rvm/gems/ruby-1.9.2-p0":String
Tasks: TOP => gettext:find
I also have to use bundle exec when performing any kind of rake task, I have the problem described here:
rake db:create Not working
Maybe that is related.
Has anyone an idea what is going on? I'm a bit desperate, sitting here since hours trying to figure it out. Google doesn't deliver any hints.
Thanks!
Olaf
I was having similar issues. I believe it comes down to an incompatibility between gettext and more recent versions of RubyGems (1.8+). There is a pull request that addresses this issue, but unfortunately it hasn't been merged yet.
In the meantime you can try adding the fork (and the commit that resolves the issue) as a dependency in your Gemfile:
group :development do
gem 'gettext', git: 'https://github.com/cameel/gettext.git', ref: 'c3a8373'
gem 'ruby_parser'
gem 'locale'
end
Install
gem 'gettext', '>=3.0.2'
As it is specified on https://github.com/grosser/gettext_i18n_rails#optional
I tried starting my Rails application but got this error message from Passenger:
Ruby on Rails application could not be started
The application has exited during startup (i.e. during the evaluation of
config/environment.rb)
/home/chuck/chuck.com/vendor/rails/railties/lib/rails/gem_dependency.rb:119:
Warning: Gem::Dependency#version_requirements is deprecated and will be removed
on or after August 2010. Use #requirement
Missing these required gems:
RedCloth
You're running: ruby 1.8.7.72 at /usr/bin/ruby1.8 rubygems 1.3.6 at
/home/chuck/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8
Run `rake gems:install`
to install the missing gems.
I installed a Rakefile in my app and tried running rake gems:install but nothing happens and no error message is printed.
How can I resolve this problem?
If it's rails-2.3.x, in your config/enfironment.rb
config.gem 'RedCloth', :lib => 'redcloth'
I have found that gems:install is spotty because of the things that people put in their environments.rb files. If this app isn't using bundler, you should gem install RedCloth and then try again.
I wrote a little more descriptive solution on how to fix this issue. You need to modify the environments.rd file and add
:lib=> 'redcloth'
Read my blog post here
http://spuder.wordpress.com/2011/08/04/missing-these-required-gems-redcloth/
I'm also getting errors sometimes when I'm using Rails. I might wonder its something to do with super user command, like:
sudo gem install <gem name>
Because for me also rake gems:install does nothing and I have to manually install the gem as sudo (I'm talking about Linux box here).