netbeans 6.9 rake error on Ubuntu 11.04 - ruby-on-rails-3

Each time I try to run a brand new rails project in Netbeans I get the following error:
"Could not find rake-0.9.2 in any of the sources (Bundler::GemNotFound)"
What's happening?
P.S: I already did a bundle install and if I run "ruby s" from the console it works.
Thx.

Try to do the same manually, i.e from the terminal. First check which version of rails you are running, then try to bundle again from the terminal.
I suppose that your environment selected in netbeans does not recognize the latest rails gem but is using another one. Check with rails -v to see which version of rails you are running. If it is ok in the terminal, make sure you are running netbeans with the same user (ex. sudo or your user depending on the rvm config you have).
I had this problem several times with different IDE and every time it was because I was not using the proper user or not using the proper gemset in RVM (it's so easy to forget !)
After that it should be easy to resolve by choosing the right environment in the config of your project in netbeans or rubymine.

Related

redmine.org not running after updated the ruby

Ruby updated to version 1.8.7 and the redmine display at the top right side "Not Running" The issue that I found is that doesn't send mailing alerts to users when the status of one task change.
The redmine save tasks normally.
Do you know why I get "Not running"?
Do you know how can I found what is not running?
Do you know how the mail alerts will work as before?
Also the redmine is hosted in cPanel.
First of all your Ruby version is very old and non-maintaned, you should look for 2.4.x versions.
I recommend that you install new ruby via rvm or rbenv
So if you are to proceed with RVM, it's easy to install via console, it first imports the key
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
And then installs via curl and bash (your should ask for permission to use bash, because often with cpanel, the only shell users can use is some kind of jailshell)
\curl -sSL https://get.rvm.io | bash -s stable
Once RVM is installed, you will be able to install new ruby for that particular user, by typing rvm install rubyversion replace rubyversion with one of your choice.
And then proceed with Redmine upgrade, as explained in manual
http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
Once you are done with that, you must figure out, how is your redmine being served, I assume it's served as fcgi module, since it's old version of ruby, so you might have to seek for a way to run your Redmine with new ruby, I recommend to try this approach first How to get rvm running inside fcgi?
There are several ways to deploy rails app like Redmine on a web-server, however running under cpanel gives you little or no choices, alternative would be to run some server like thin, or webrick, and proxy it thru apache, which should be possible with cpanel.

Passenger throws Bundler::GemfileError after "gem update --system"

Background
On my local machine, I tried installing the 'bullet' gem via my gemfile, and bundle seemed to go without incident, however upon restarting my app passenger began throwing the error Invalid gemspec for uniform_notifier. It seems someone else had this issue and the suggested resolution on StackOverflow said to update RubyGems by running:
The issue
gem update --system
This produced no error messages upon running, however now none of apps will start. They all give the same vague Passenger error:
PhusionPassenger::UnknownError
There was an error in your Gemfile, and Bundler cannot continue. (Bundler::GemfileError)
I removed 'bullet' from my gemfile so it's now back in a state when it was working yesterday, so I don't think there can be an error in my gemfile. Furthermore, all of my other apps are now broken and their gemfiles haven't changed at all.
For reference:
ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0]
rails -v
Rails 3.2.6
rvm --version
rvm 1.1.4 by Wayne E. Seguin
And when I do gem list for the global and local gemsets, it shows bundler 1.1.0 installed.
Edit: I should also mention that running rails s starts up a WEBrick server just fine and I can access my apps at localhost:3000, so it's only under Passenger that this error crops up.
Have you committed your Gemfile.lock?
I was able to fix this by rolling back rubygems-update to the previously installed version by running
gem update --system 1.8.11
At which point all of my apps began working again. I'm still not sure what the problem was, and will gladly switch the accepted answer from my own to someone who can provide more insight into why updating rubygems-update would break Passenger integration.
I wish someone from Phusion Passenger would give a definitive answer but just wanted to say that I've experienced the same thing. Updating rubygems has broken passenger-nginx integration for us and requires recompiling the passenger-nginx module. Not sure why this would be. My speculation is that the module is somehow compiled with a hard reference to a specific version of rubygems.

Difficulty with activesupport when attempting to deploy

I have a rails application that I am trying to deploy onto the internet. I have setup a server on the Amazon EC2 cloud, that I know works because I have deployed another site to the same machine.
When I try to run this new application either through 'rails console' or when running 'rake db:seed' or just by trying to browse to the application, rails crashes saying it cannot find activiesupport:
/home/ec2-user/.gem/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/core_ext/big_decimal/conversions.rb:1:in `require': cannot load such file -- bigdecimal (LoadError)
My Rails version is 3.2.2 and I'm using ruby 1.9.3p0 (2011-10-30) [x86_64-linux]. My database is MongoDB which I access through Mongoid. And I'm using Passenger and Apache as a server.
Is there any configuration step or something like that that I have missed?
P.S. I know I shouldn't be using ec2-user, I'm still experimenting. And also, I've never had much luck with RVM.
I encountered the same problem with Rails 3.2.3 and Ruby 1.9.3p0 on my Amazon EC2 instance, where Ruby had been installed with the ruby19 yum package. In my case, the problem seemed to be that I had installed the bigdecimal gem manually using the gem command instead of using Bundler. To fix the problem, I uninstalled the gem manually, added the line
gem 'bigdecimal'
to my application's Gemfile, and re-ran bundle install. This reinstalled the gem and then my application was able to load it successfully.
My gems are also installed in ~/.gem/ruby/1.9.1/, even though I am running Ruby 1.9.3p0. This does not appear to be a problem.

rails command doesn't work

I've tried to start the rails server with this line:
$ rails s
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
...
create log/test.log
But if I write down this:
$ script/rails s
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:138: warning: Insecure world writable dir /usr/lib/ruby/gems/1.8 in PATH, mode 040777
=> Booting WEBrick
=> Rails 3.0.1 application starting in development on http://0.0.0.0:3000
...
Anyone can see the problem? I think is a problem with environment variables, but I don't know how to fix it.
Thanks
I just came across this problem. I was switching from a Windows environment to Linux. My Linux version of rails is 2.3.14 while my Windows version was 3.0.1. On Windows "rails s" or "rails server" worked as expected to start a server, but on Linux it just created new projects with the names "s" and "Server" respectively. What finally explained it is the answer to the question below. Apparently the command behavior was changed between rails versions.
rails script/server doesn't start the server
The best solution is probably to update to the latest rails.
I was able to do that on my linux box by following the instructions below and using "sudo gem install rails"
http://installfest.railsbridge.org/installfest/ubuntu
http://root2linux.com/2011/01/install-rails-3-on-linux-mint-10/
this issue come from the different version in rvm, I faced this issue when my app was created using rvm 1.9.2 and I tried to run the server while rvm 1.9.3 was the running rvm version, simply switch to rvm1.9.2 and all will work properly (rvm use 1.9.2) in the terminal in ubunutu
Are you in a rails application directory? When you're running rails s make sure you've cd'd into the correct Rails directory. Common problem :)

Running Rails server on ubuntu

I'm trying to get rails running on Ubuntu (11.04). I've installed my gems and whatnot -- I can see all of them thru 'gem list'. However, when I run the command rails s or rails server, rails for some reason tries to create a new app called 's' or 'server' (respectively) instead of running the server. Any advice?
check the output of rails -v, it'll probably report rails 2.3.x - that will be your problem.