RVM and rails 3.0 beta: rails executable is invalid - ruby-on-rails

after installing
gem install rails --pre
then trying
rails -v
I get the following error
/home/luke/.rvm/gems/ruby-1.8.7-head#rails3pre/gems/activerecord-3.0.0.beta2/lib/rails: Is a directory - /home/luke/.rvm/gems/ruby-1.8.7-head#rails3pre/gems/activerecord-3.0.0.beta2/lib/rails (Errno::EISDIR)
from /usr/bin/rails:19:in `load'
from /usr/bin/rails:19
Env details
rvm -v
rvm 0.1.26
gem list
abstract (1.0.0)
actionmailer (3.0.0.beta2)
actionpack (3.0.0.beta2)
activemodel (3.0.0.beta2)
activerecord (3.0.0.beta2)
activeresource (3.0.0.beta2)
activesupport (3.0.0.beta2)
arel (0.3.3)
builder (2.1.2)
bundler (0.9.18)
erubis (2.6.5)
i18n (0.3.6)
mail (2.1.5.3)
memcache-client (1.7.8)
mime-types (1.16)
polyglot (0.3.1)
rack (1.1.0)
rack-mount (0.6.1, 0.4.7)
rack-test (0.5.3)
rails (3.0.0.beta2)
rails3b (3.0.1)
railties (3.0.0.beta2)
rake (0.8.7)
rdoc (2.5.3)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.13.4)
treetop (1.4.5)
tzinfo (0.3.19)
Any ideas?

nm, I found it. I had to open a new terminal. I also uninstalled a prior version of rails somewhere along the way, within the same rvm rubie, and might have killed the rails bin file.

I got rid of this error by simply deleting the /var/lib/gems/1.8/bin that appeared in the PATH variable definition in /etc/profile.

Related

Unable to start any debugging session in Aptana 3

I cannot seem to launch any debugging session from within Aptana Studio 3. I click "Debug Server" but nothing shows up anywhere and nothing happens.
I have found a couple various posts, none of which actually solved my problem. I'm a noob when it comes to ruby on rails development (I'm a seasoned Visual Studio user, however) so I imagine there's something I'm doing that's dumb.
Here is my setup:
1) $ rails -v Rails 4.1.0
2) $ ruby -v
ruby -v
ruby 2.0.0p451 (2014-02-24) [x64-mingw32]
3) DevKit is installed
4) ruby-debug-ide is installed:
$ gem list
* LOCAL GEMS *
actionmailer (4.1.0)
actionpack (4.1.0)
actionview (4.1.0)
activemodel (4.1.0)
activerecord (4.1.0)
activesupport (4.1.0)
arel (5.0.1.20140414130214)
bigdecimal (1.2.0)
builder (3.2.2)
bundler (1.6.2)
coffee-rails (4.0.1)
coffee-script (2.2.0)
coffee-script-source (1.7.0)
debase (0.0.9)
debugger-ruby_core_source (1.3.2)
erubis (2.7.0)
execjs (2.0.2)
hike (1.2.3)
i18n (0.6.9)
io-console (0.4.2)
jbuilder (2.0.7)
jquery-rails (3.1.0)
json (1.8.1, 1.7.7)
mail (2.5.4)
mime-types (1.25.1)
minitest (5.3.3, 4.3.2)
multi_json (1.9.3)
polyglot (0.3.4)
psych (2.0.0)
rack (1.5.2)
rack-test (0.6.2)
rails (4.1.0)
railties (4.1.0)
rake (10.3.1, 0.9.6)
rbx-require-relative (0.0.9)
rdoc (4.1.1, 4.0.0)
ruby-debug-ide (0.4.22)
sass (3.2.19)
sass-rails (4.0.3)
sdoc (0.4.0)
sprockets (2.12.1, 2.11.0)
sprockets-rails (2.1.3)
sqlite3 (1.3.9 x64-mingw32)
test-unit (2.0.0.0)
thor (0.19.1)
thread_safe (0.3.3)
tilt (1.4.1)
treetop (1.4.15)
turbolinks (2.2.2)
tzinfo (1.1.0)
uglifier (2.5.0)
3) Aptana Studio 3
4) Windows 7, 64-bit.
I made a quick YouTube video of me showing the issue as well as showing some locally installed gems, etc. Perhaps this reveal what I'm doing wrong.
http://www.youtube.com/watch?v=5QcK_cKYxCs&feature=youtu.be
Thanks in advance.
Rails 4.0 project not starting through aptana studio 3
Ooops. It was found already. The problem was my error was different (I was seeing no output); but the resolution was the same.
Basically just create a Script folder in the project directory and copy over the "rails" executable (found within your bin folder) to this directory.

Could not find RubyGem railties (>= 0) (Gem::LoadError) with the RailsInstaller

In Ruby on Rails, I am trying to install it on my Windows machine following the step-by-step instructions indicated in http://railsinstaller.org/windows
On step 7, it says we should type in this command:
$ rails g controller welcome index
And so I do:
PS C:\Sites\railsinstaller_demo> rails g controller welcome index
And I get this error:
C:/Program Files/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems.rb:926:in
`report_activate_error': Could not find RubyGem railties (>= 0) (Gem::LoadError)
from C:/Program Files/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems.rb:244:in
`activate_dep'
from C:/Program Files/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems.rb:236:in `activate'
from C:/Program Files/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems.rb:1307:in `gem'
from C:/RailsInstaller/Ruby1.9.3/bin/rails:18:in `<main>'
I have googled this error and read that the solution was to install de DevKit and so I did, but the problem remains.
What causes these errors?
Edit:
This is what appears when I run gem list:
PS C:\Sites\railsinstaller_demo> gem list
*** LOCAL GEMS ***
actionmailer (3.2.9)
actionpack (3.2.9)
activemodel (3.2.9)
activerecord (3.2.9)
activeresource (3.2.9)
activesupport (3.2.9)
arel (3.0.2)
builder (3.0.4)
erubis (2.7.0)
foreman (0.60.2)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
mail (2.4.4)
mime-types (1.19)
minitest (1.6.0)
multi_json (1.5.0)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
rake (0.8.7)
rdoc (2.5.8)
rest-client (1.6.7)
sequel (3.20.0)
sinatra (1.0)
sprockets (2.2.2)
taps (0.3.24)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.12)
tzinfo (0.3.35)
As suggested by #EricLeschinski I tried tu run "gem install rails" but this error appeared:
PS C:\Sites\railsinstaller_demo> gem install rails
ERROR: Error installing rails:
The 'json' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
Final edit:
In the end, I don't how bad I messed up my initial installation, but I found this Youtube video http://www.youtube.com/watch?v=WUdDdiu8kBs which turned out to be the clearest way to install everything that I needed and had no problem at all following her instructions.
Could not find RubyGem railties
This error is due to the difference between the rails version you are using and the one defined in the Gemfile.
Try rails -v to check the rails version.
Reference : https://www.railstutorial.org/book/toy_app

Ruby on Rails issue in Windows 7 behind websense and firewall

Regarding Ruby on rails in windows 7. after installing the railsinstaller, I am facing lot of issue and not sure what the cause is?
PS: I posted this question on stack-overflow, somewhere else while looking for answer of similar issue, where a gentleman suggest me to put my question on separate thread. And here it goes.
The windows 7 is behind proxy and websense. I run all applications as administrator. I wonder if I left any site/blog for the issues I am facing. Though it is my first question here on ROR in stack-overflow after I exhausted options of reading and searching to resolve it.
I am even not able to do the
$ gem install rubygems-update
though I the path is correct and showing
c:\>gem sources
display
http://rubygems.org.
as the only source.
I am still getting the below error for the even simple database creation. That was given in root directory of sample rails project namely SampleROR.
Any help please.
$ rake db:create
The i18n gem is not available. Please add it to your Gemfile and run bundle install
rake aborted!
cannot load such file -- i18n
c:/RailsInstaller/DevKit/home/anil-ku/SampleROR/config/application.rb:3:in `require'
c:/RailsInstaller/DevKit/home/anil-ku/SampleROR/config/application.rb:3:in `<top (required)>'
c:/RailsInstaller/DevKit/home/anil-ku/SampleROR/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
Note that I am not able to do
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem update --system
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
with latest version of rails, installed using railsinstaller one click for windows.
I did the bundle install after this, that run successfully but the issue didn't disappear.
anil-ku#hostname ~/SampleROR
$ bundle install
Using rake (10.0.2)
**Using i18n (0.6.1)**
Using multi_json (1.4.0)
Using activesupport (3.2.1)
Using builder (3.0.4)
Using activemodel (3.2.1)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.1)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.1)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.1)
Using activeresource (3.2.1)
Using bundler (1.0.22)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.1)
Using coffee-rails (3.2.2)
Using jquery-rails (2.1.4)
Using rails (3.2.1)
Using sass (3.2.3)
Using sass-rails (3.2.5)
Using sqlite3 (1.3.6)
Using uglifier (1.3.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem
is installed.
anil-ku#DS-7071BC8FD6C4 ~/SampleROR
**$ bundle show i18n**
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/i18n-0.6.1
when I list
$gem list -local
actionmailer (3.2.1)
actionpack (3.2.1)
activemodel (3.2.9, 3.2.1)
activerecord (3.2.1)
activerecord-sqlserver-adapter (3.2.1)
activeresource (3.2.1)
activesupport (3.2.9, 3.2.1)
archive-tar-minitar (0.5.2)
arel (3.0.2)
bigdecimal (1.1.0)
builder (3.0.4, 3.0.0)
bundler (1.0.22)
cgi_multipart_eof_fix (2.5.0)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0, 1.2.0)
columnize (0.3.6)
daemons (1.1.9)
debugger-linecache (1.1.2)
debugger-ruby_core_source (1.1.5)
deprecated (3.0.1, 2.0.1)
erubis (2.7.0)
execjs (1.4.0, 1.3.0)
fastthread (1.0.7)
gem_plugin (0.2.3)
hike (1.2.1)
hoe (3.3.1)
**i18n (0.6.1, 0.6.0)**
io-console (0.3)
journey (1.0.4, 1.0.2)
jquery-rails (2.1.4)
json (1.7.5, 1.5.4)
mail (2.4.4, 2.4.1)
mime-types (1.19, 1.17.2)
minitest (4.3.3, 2.5.1)
multi_json (1.4.0, 1.3.7, 1.1.0)
mysql2 (0.3.11)
permutation (0.1.8)
pg (0.13.1 x86-mingw32)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2, 1.1)
rack-ssl (1.3.2)
rack-test (0.6.2, 0.6.1)
rails (3.2.1)
railties (3.2.1)
rake (10.0.2, 0.9.2.2)
rake-compiler (0.8.1)
rb-readline (0.4.2)
rbx-require-relative (0.0.9)
rdoc (3.12, 3.9.4)
ruby_core_source (0.1.5)
rubyzip (0.9.6.1)
sass (3.2.3)
sass-rails (3.2.5)
sdoc (0.3.20)
sprockets (2.1.3, 2.1.2)
sqlite3 (1.3.6 x86-mingw32, 1.3.5 x86-mingw32)
sqlite3-ruby (1.3.3)
thor (0.14.6)
tilt (1.3.3)
tiny_tds (0.5.1 x86-mingw32)
treetop (1.4.12, 1.4.10)
tzinfo (0.3.35, 0.3.31)
uglifier (1.3.0)
It shows i18n installed. Not sure what is the issue.
$ rails --version
Rails 3.2.1
also, downloading gem package and run it using ruby setup.rb also didn't work
C:\RailsInstaller\rubygems>ruby setup.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems.rb:480:in `find_files': undefined method `map' for Gem::Specification:Class (NoMethodError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems.rb:1085:in `load_plugins'
from C:/RailsInstaller/rubygems/lib/rubygems/gem_runner.rb:84:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from setup.rb:25:in `<main>'
C:\RailsInstaller\rubygems>
My gem version is
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem -v
1.8.16
I tried to download gem manually from site (from http://rubygems.org/gems/) and installed few of them. So able to install some while for most other gems it give error like below
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel_services
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel_service
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel_service-0.4.0.gem
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel-1.1.5.gem
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel2-0.34.0.gem
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install win32-api-1.4.8.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed win32-api-1.4.8
1 gem installed
Installing ri documentation for win32-api-1.4.8...
Installing RDoc documentation for win32-api-1.4.8...
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install windows-api-0.4.2.gem
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
Finally my environment details for gem is
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.16
- RUBY VERSION: 1.9.3 (2012-02-16 patchlevel 125) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/RailsInstaller/Ruby1.9.3/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1
- C:/Users/anil-ku/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>
I note that there is nothing like ruby folder under
C:/Users/anil-ku/.gem/ruby/1.9.1
the only thing under the above one is a folder named specs that looks irrelevant.
Also the path environment is windows is
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>echo %PATH%
C:\RailsInstaller\Ruby1.9.3\bin;C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\bin;C:\RailsInstaller\DevKit\bin;C:\RailsInstaller\Git\c
md;C:\RailsInstaller\Ruby1.9.3\bin;C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\bin;C:\RailsInstaller\DevKit\bin;C:\RailsInstaller\Gi
t\cmd;C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby1.9.3\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Syste
m32\WindowsPowerShell\v1.0\;;C:\Program Files\cvsnt;C:\Program Files\TortoiseSVN\bin;d:\RailsInstaller\Git\cmd;d:\RailsInstaller\Ruby1.9
.3\bin
Any help for how to proceed for simple database connection with above and/or how to install gem fully?
You need to set your proxy settings for rubygems. For example set the Environment Variable like so:
SET HTTP_PROXY=http://wolfbyte:secret#pigsy:8080
From https://stackoverflow.com/a/4431/192221

Ruby on rails passenger apache problem

I did, gem install passenger, passenger-install-apache2-module
http://localhost/
I'm getting this error.
http://pastebin.com/YfrEsv3X
Update
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.8)
actionpack (3.0.8)
activemodel (3.0.8)
activerecord (3.0.8)
activeresource (3.0.8)
activesupport (3.0.8)
arel (2.1.1, 2.0.10)
bcrypt-ruby (2.1.4)
builder (3.0.0, 2.1.2)
bundle (0.0.1)
bundler (1.0.15)
daemon_controller (0.2.6)
devise (1.3.4)
erubis (2.7.0, 2.6.6)
fastthread (1.0.7)
i18n (0.6.0, 0.5.0)
mail (2.3.0, 2.2.19)
mime-types (1.16)
mysql (2.8.1)
mysql2 (0.3.2)
orm_adapter (0.0.5)
passenger (3.0.7)
pg (0.11.0)
polyglot (0.3.1)
postgres-pr (0.6.3)
rack (1.3.0, 1.2.3)
rack-mount (0.8.1, 0.6.14)
rack-test (0.6.0, 0.5.7)
rails (3.0.8)
railties (3.0.8)
rake (0.9.2, 0.8.7)
rubygems-update (1.8.5)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.27)
warden (1.0.4)
You need to install the bundler gem as well.
Update
Now that the OP has posted his gemset...
You must have two gemsets, usually this is because you're using two different rubys. The gem command is just a script, with a shebang line pointing to a Ruby. The gem list you're showing will be the gemset for that Ruby. You can see this with this command: head -1 $(which gem)
Your passenger configuration must be pointing to a different Ruby with a different gemset. You can see this in your passenger.conf lines for Apache.
I suspect after installing the bundler gem - you may experience other problems if your Gemfile doesn't include all the gems your project requires.
So next time - look at the error message.
no such file to load -- bundler
from the above example - you can notice that 'bundler' is causing the problem.
That will give you a clue as what other gems you'd need to install and possibly missed out in your Gemfile - in which case issue the command:
gem install <missing-gem>

Ruby on Rail gem install activerecord-sqlserver-adapter error

I'm trying to run rake commands on my local SQL server database using ODBC. I have setup the ODBC connections and thought I had the rails end covered however, i'm running into this error.
Please install the sqlserver adapter: gem install activerecord-sqlserver-adapter (no such file to load -- active_record/connection_adapters/sqlserver_adapter)
I have the following gems installed:
abstract (1.0.0)
actionmailer (3.0.5)
actionpack (3.0.5)
activemodel (3.0.5)
activerecord (3.0.5, 1.15.6)
activerecord-sqlserver-adapter (3.0.10)
activeresource (3.0.5)
activesupport (3.0.5, 1.4.4)
arel (2.0.9)
builder (3.0.0, 2.1.2)
bundler (1.0.10)
dbd-odbc (0.2.4)
dbi (0.4.1)
deprecated (3.0.0, 2.0.1)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.15)
mime-types (1.16)
minitest (2.0.2, 1.6.0)
odbc-rails (1.5)
polyglot (0.3.1)
rack (1.2.2)
rack-mount (0.7.1, 0.6.14)
rack-test (0.5.7)
rails (3.0.5)
railties (3.0.5)
rake (0.8.7)
rdoc (3.5.3, 2.5.8)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.25)
Am I missing a gem? What else do I need to get this running on my windows box?
Thanks in advance for any help :-)
Try to add such line in your %APP_ROOT%/Gemfile
gem 'activerecord-sqlserver-adapter'
Also, your way behind on the times. First the DBI/DBD-ODBC were removed from the adapter stack about a year ago. Also, the easiest way (and best performance) is to use TinyTDS for the connection mode. See there wiki here.
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTds

Resources