How to configure rvm with netbeans - ruby-on-rails-3

I have installed ruby 1.9.2-p1890 in my rvm and the gem directory is
/Users/abhay/.rvm/gems/ruby-1.9.2-p180
My netbeans detected the rvm and the ruby installed but when i right click the project properies->manage
gem home is - /Users/abhay/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1
gem path is - /Users/abhay/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1
gem tool is - /Users/abhay/.rvm/rubies/ruby-1.9.2-p180/bin/gem (1.8.24)
interpreter - /Users/abhay/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
and when I run my project, I get this error
/Users/abhay/.rvm/rubies/ruby-1.9.2-p180/bin/ruby: No such file or directory -- script/server (LoadError)

Related

ruby on rails server is not running

i m new to ruby on rails can any one help me. i cant start my rails server below is the error which m getting
i also tried by installing bundle but getting same error
ahaad#Labbaik:~/Desktop/Ruby_Pro/App_demo$ rails server
Could not find gem 'jquery-rails (>= 0) ruby' in the gems available on this machine.
Run bundle install to install missing gems.
Install this gem separately:
gem install jquery-rails
and run the bundle:
bundle install
(or)
Look up your Gemfile, add gem 'jquery-rails' if Gemfile not contain it, then at your terminial, run
bundle install

Rails server is not starting?

i have succesfully installed rails 3.2.8, ruby 1.9.3, gems are also updated.
when rails server command is entered in myapp folder following error is displayed
←[31mCould not find gem 'jquery-rails (>= 0) x86-mingw32' in the gems available
on this machine.←[0m
←[33mRun bundle install to install missing gems.←[0m
Did you install the corresponding gems by using
gem install jquery-rails
or run the bundle install command in console before you start the rails server?

Gem::LoadError: Could not find rubygems-bundler (>= 0) amongst []

I'm running rvm with ruby 1.9.3. I've ran bundle install and it worked fine. But when I run bundle install --deployment I get this:
volunteer-app ➜ bundle install --deployment
Fetching gem metadata from http://rubygems.org/.......
Installing rake (0.9.2.2)
Gem::LoadError: Could not find rubygems-bundler (>= 0) amongst []
An error occured while installing rake (0.9.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.
After this is ran I look in the vendor/bundle/ruby directory and it shows 1.9.1. So it looks like bundle install --deployment isn't recognizing my gems in from rvm's default ruby version 1.9.3.
Any thoughts on what I could be missing.
Edit
Here's my gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/sosl/.rvm/gems/ruby-1.9.3-p194#teer
- RUBY EXECUTABLE: /home/sosl/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
- EXECUTABLE DIRECTORY: /home/sosl/.rvm/gems/ruby-1.9.3-p194#teer/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/sosl/.rvm/gems/ruby-1.9.3-p194#teer
- /home/sosl/.rvm/gems/ruby-1.9.3-p194#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
It's a bug in both rubygems-bundler and bundler, I have already fixed it for rubygems-bundler and a fix for bundler is waiting for merge.
Fastest way to fix is to update rubygems-bundler:
gem update rubygems-bundler
For reference here is pull request for bundler:
https://github.com/carlhuda/bundler/pull/1925
I really feel for you as I just went though something simular last night. While I am certainly not an expert (I am just a student of RoR as you are) can I make some suggestions?
After you use RVM to change into your RUBY version, run a "local" gem list to see what gems are installed locally. Do you have the gem installed in your local gems?
Sometimes gem files get "Jumbled" and stop working altogether. Have you tried to uninstall and then reinstall the gems? The command is simple. In your console type "gem uninstall (the name and version number of the gem you wish to uninstall). It may reply that the gem you wish to uninstall has dependencies on other gems you have installed. Don't worry once you reinstall those gems the dependencies will be satisfied.
I don't know if Bundler is installed automatically or not. Is it listed in your "Local" gems or in your gemfile.lock?
Best of luck in correcting this.

rails 3: gems installed successfully, but cannot use them in my app

I did a clean install of rails 3.0.6. My app is running fine, except that I cannot use all the gems that didn't come with rails 3. All of them are in gem list. I also have them in Gemfile and have ran bundle install and bundle update.
For example, with matthuhiggins-foreigner:
upon rake db:migrate, it complains
that add_foreign_key is not defined.
I have the same problem with less:
no .css generated from .less)
geokit-rails3:
Unknown key(s): origin, within
gem which geokit-rails3 returns:
/Library/Ruby/Gems/1.8/gems/geokit-rails3-0.1.3/lib/geokit-rails3.rb
gem environment returns:
RubyGems Environment:
- RUBYGEMS VERSION: 1.5.0
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/administrator/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I have looked into this problem for a long time. Please help!
Thanks!
Rails 3 does not load any gems that are not listed in your Gemfile, even if they are installed on your system. You need to explicitly list them there first.
The typical workflow in R3 is not to install your gems and then use them, but to write entries in the Gemfile and then install them by installing bundler with "gem install bundle" and getting all the remaining gems with "bundle install". Bundle install will install any required gems you do not already have, but will use the ones you do have.
(Bundle update, suggested by another user, will bump all your gems to the most recent available version that matches your requirements as laid out in the Gemfile, even if the ones already installed satisfy the requirements). i.e. if you need foo_gem >= 1.0 and you have foo_gem 1.0.1 installed, "bundle install" won't change it but "bundle update" will install foo_gem 1.0.3 if it's available.
If you are working on multiple applications that have conflicting (or potentially conflicting) gems, then I recommend learning about RVM and creating a gemset for each project. This is especially valuable if you are still working on any Rails 2.x projects alongside your R3 projects.
Try this:
Update gem by running gem update --system
Make sure your gemfile lists the gems
Run bundle update to update all your gems in the gemfile
Hopefully that should do the trick.
I came back to this problem after a few days and I fixed all the issues!
matthuggins-foreigner gem is called foreigner, so I added this to Gemfile:
gem 'foreigner'
With geokit, I simply followed the instructions here:
https://github.com/jlecour/geokit-rails3
With less, I installed the less gem and the more plugin, then restarted the server:
https://github.com/cloudhead/more

glassfish gem installation issue

When I do a gem install glassfish, I get an error:
"ERROR: Could not find a valid gem 'glassfish' (>= 0), here is why:
Found glassfish (0.1.2), but was for platforms universal-java-1.5 ,universal-java"
What should I do to fix this error?
You probably have another (non-JRuby) ruby implementation installed locally, and the gem command you are running uses that other impl. Run:
jruby -S gem install glassfish
Or, if you use rvm, switch back to a JRuby impl:
rvm jruby
gem install glassfish