I am getting started on Rails and I am trying to rectify my issue of "ExecJS::ProgramError in Pages#home" while setting up first page as suggested below
downgrading the gem coffee-script-source' from 1.9.1 to 1.8.0
But to which gem file should I add? I see a whole of folders under the GEM PATHS as shown by the result of the command GEM ENV
Also when I run from the command line I get the below error( I assume this is not the way to do it)
C:\Sites\myrails\App>gem coffee-script-source 1.8.0
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command coffee-script-source
Any help would be really appreciated?
My Rails env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.7
- RUBY VERSION: 2.1.5 (2014-11-13 patchlevel 273) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/RailsInstaller1.0/Ruby2.1.0/lib/ruby/gems/2.1.0
- RUBY EXECUTABLE: C:/RailsInstaller1.0/Ruby2.1.0/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/RailsInstaller1.0/Ruby2.1.0/bin
- SPEC CACHE DIRECTORY: C:/Users/baskaran/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/RailsInstaller1.0/Ruby2.1.0/lib/ruby/gems/2.1.0
- C:/Users/baskaran/.gem/ruby/2.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- C:\RailsInstaller1.0\Git\cmd
- C:\RailsInstaller1.0\Ruby2.1.0\bin
- C:\RailsInstaller1.0\Ruby2.1.0\lib\ruby\gems\1.9.1\bin
- C:\RailsInstaller1.0\DevKit\bin
As per the suggestion - tried to do the following
C:\Sites\myrails\App>gem install coffee-script-source -v 1.8.0
Successfully installed coffee-script-source-1.8.0
Parsing documentation for coffee-script-source-1.8.0
Installing ri documentation for coffee-script-source-1.8.0
Done installing documentation for coffee-script-source after 0 seconds
1 gem installed
But still getting the below when trying to access localhost:3000/pages/home
TypeError: Object doesn't support this property or method
(in C:/RailsInstaller1.0/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)
Generally these things are managed via the Gemfile. If you need to downgrade:
gem 'coffee-script-source', '1.8.0'
Then do bundle install.
Remember the command you're looking for to do a manual install is:
gem install coffee-script-source -v 1.8.0
I think I solved by this editing the Gemfile in my app directory to add
gem 'coffee-script-source', '1.8.0'
and then run
bundle install coffee-script-source
Thanks
Related
I've a Rails app that needs to use bundler version
gem "bundler", ">= 2.2.17", "<= 2.2.30"
I've installed bundler version 2.2.30 using gem install bundler:2.2.30 --default. Running gem list bundler returns the following
*** LOCAL GEMS ***
bundler (default: 2.2.30)
but the issue is that bundler version returns a different version(2.1.2) than 2.2.30. It returns
Bundler version 2.1.2
which bundler gives
/Users/masroor/.rbenv/shims/bundler
and whenever I try to bundle the app using bundle _2.2.30_ install or try running rails server/console, it does not pick up the right bundler version(2.2.30) instead it uses 2.1.2
Trying to do bundle _2.2.30_ install fails with this error
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (>= 2.2.17, <= 2.2.30)
Current Bundler version:
bundler (2.1.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?
Could not find gem 'bundler (>= 2.2.17, <= 2.2.30)' in any of the relevant sources:
the local ruby installation
The gem env installation path does not contain the bundler gemspec against 2.1.2 bundler version.
Output of gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.1.2
- RUBY VERSION: 2.7.0 (2019-12-25 patchlevel 0) [x86_64-darwin19]
- INSTALLATION DIRECTORY: /Users/masroor/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0
- USER INSTALLATION DIRECTORY: /Users/masroor/.gem/ruby/2.7.0
- RUBY EXECUTABLE: /Users/masroor/.rbenv/versions/2.7.0/bin/ruby
- GIT EXECUTABLE: /usr/local/bin/git
- EXECUTABLE DIRECTORY: /Users/masroor/.rbenv/versions/2.7.0/bin
- SPEC CACHE DIRECTORY: /Users/masroor/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/masroor/.rbenv/versions/2.7.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-19
- GEM PATHS:
- /Users/masroor/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0
- /Users/masroor/.gem/ruby/2.7.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/masroor/.rbenv/versions/2.7.0/bin
- /usr/local/Cellar/rbenv/1.2.0/libexec
- /usr/local/opt/mysql#5.7/bin
- /Users/masroor/.rbenv/shims
- /Users/masroor/.nvm/versions/node/v10.16.3/bin
- /usr/local/opt/mysql#5.7/bin
- /Users/masroor/.rbenv/shims
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Library/Apple/usr/bin
- /Library/Apple/bin
The installed gemspecs for bundler, returned by ls /Users/masroor/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/specifications/default/ | grep bundler are
bundler-2.2.30.gemspec
I'm using rbenv for ruby version management, running ruby -v returns
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
which ruby returns
/Users/masroor/.rbenv/shims/ruby
I tried to find files pertaining to bundler 2.1.2 in my filesystem with
find / -type f -name bundler | grep bundler | grep 2.1.2
and found the following
/System/Volumes/Data/Users/masroor/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.2/libexec/bundler
/Users/masroor/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.2/libexec/bundler
when I try to uninstall bundler version 2.1.2 with gem uninstall bundler:2.1.2 I get
Gem 'bundler' is not installed
I used the gem list command in powershell and cygwin and both show different gem lists.
Cygwin shows
*** LOCAL GEMS ***
bundler (1.2.3)
json (1.7.5)
minitest (2.12.1)
rake (0.9.2.2)
rdoc (3.12)
while in powershell I see :
*** LOCAL GEMS ***
io-console (0.3)
json (1.5.4)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.4)
sass (3.2.1)
So, the versions of same gem are also different in two.
Why is it so? Also, I was getting problems with bundle install while using rails(int both Cygwin and Powershell). Can it be because of this?
How do I ensure consistency in gems? Doesn't installing a gem via Powershell/cygwin make it available to the entire system?
So, I would like to install a fresh copy of gems and Rails which is consistent across Powershell and cygwin. How do I do that?
running gem environment in cygwin gives this:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2012-11-10 patchlevel 327) [i386-cygwin]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby.exe
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-cygwin
- GEM PATHS:
- /usr/lib/ruby/gems/1.9.1
- /cygdrive/c/SPB_Data/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
and in windows powershell it gives :
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby193/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: C:/Ruby193/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby193/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby193/lib/ruby/gems/1.9.1
- C:/SPB_Data/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I can only guess based on what information you have given, but it sounds like you have a separate version of ruby installed in cygwin and windows.
One easy way to tell what's going on is to do a ruby -v and gem environment in both shells, which will tell you which ruby version you are using, and what version ruby thinks it's using, and where Rubygems is looking for gems.
To ensure consistency in gems on windows, I would suggest having one ruby installed and using Bundler to maintain your gems through Gemfile. Remove the ruby you installed through cygwin, and ensure the ruby you use is the same one in both environments (try ruby -v)
However, I'm not sure why you're getting bundler errors based on the information you've given.
EDIT AFTER UPDATE
So you definitely have two different versions of ruby installed, each with their own unique set of gems. You cannot use the windows version in cygwin, so what I would do would be uninstall the cygwin version (use the cygwin setup.exe to do this! If you don't have it, download it again from the cygwin website. You can indicate packages to remove as well as add) and make sure the /cygdrive/c/ruby193/bin is in your cygwin path, so that which ruby and which gem points at this directory.
When I tries to install rails:
root#li44-48:/# gem install rails
Successfully installed rails-3.2.1
1 gem installed
Installing ri documentation for rails-3.2.1...
Installing RDoc documentation for rails-3.2.1...
But when I do:
root#li44-48:/# rails
-bash: rails: command not found
I checked gem env and it displays:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [i686-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.9.1
- /root/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Also the folder root#li44-48:/usr/lib/ruby/gems/1.9.1/gems/rails-3.2.1# is empty.
Any ideas on how to fix this?
I had the same issue after switching to an older version of Rails (3.2.16) from 4.0.2.
In my case it looks like railties need to be uninstalled as well - not just the rails gem.
Here's what I've done:
gem uninstall rails # choose to remove all
gem uninstall railties # choose to remove all
gem install rails -v 3.2.16
This happened to me after I uninstalled an old version of rails, and it asked me if I wanted to remove the binary too (which I did).
The newer rails binary is hidden under
/var/lib/gems/1.9.1/gems/railties-3.2.13/bin/rails
(on Ubuntu)
So I just created the symlink (not sure if this has negative side affects but it seems to work):
sudo ln -s /var/lib/gems/1.9.1/gems/railties-3.2.13/bin/rails /usr/local/bin
In an effort of rage quit, I:
removed ruby
removed gem
and recompiled both from source, and now gem install rails is fully working again.
I had the same issue and ended up using the RVM installer. This post http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ shows you how and why use this tool.
check that rvm is a function type rvm | head -1
Try installing with:
sudo gem install rails
If you are running RVM you may not have it configured properly.
I'm trying to figure out this eclipse aptana plugin (coming from a visual studio background). When I try to debug my project as follows:
It throws this error:
Unable to find 'rdebug-ide' binary script. May need to install 'ruby-debug-ide' gem, or may need to add your gem executable directory to your PATH (check location via 'gem environment').
This is gem environment:
RubyGems Environment:
- RUBYGEMS VERSION: 1.5.2
- RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby192/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: C:/Ruby192/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby192/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby192/lib/ruby/gems/1.9.1
- C:/Users/Lol/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
The server can be started, I can go to localhost:3000 and it loads. But I dont understand this error or how to get debugging started. Any idea what is wrong?
PS. Coming from an asp.net mvc background, I can right click controllers folder and add controller. Then right click an action and generate a view for it. Can I not do this in ruby on rails development?
Issue the following command from the command line:
gem install ruby-debug-ide
The error message is saying that you don't have this gem installed. It seems as though Aptana does not check to see what gems are installed before activating certain features.
In case you don't know what a gem is, think of it as a plugin that is installed system-wide.
Take a look at this post for installing ruby debug for ruby 1.9.3
I was having the same problem as Mel Padden in osX. With the gem already installed it threw me the same error(I have rvm installed).What I did it was make a symbolic link to aptana and after that invoke it from console.
$ ln -s /Applications/Aptana\ Studio\ 3/AptanaStudio3.app/Contents/MacOS/AptanaStudio3 /usr/local/bin/aptana
$ aptana&
Is not the best solution, but it works :)
I'm also having this problem on 64-bit Ubuntu.
Not only can I not debug, now when I open the IDE it gives strange UI errors. The package explorer won't display and dialogs keep popping up.
Here's the listing I get from my Rails install
Installing RDoc documentation for ruby-debug-ide-0.4.16...
mel#ubuntu:/usr/share/eclipse/features$ gem list
*** LOCAL GEMS ***
cgi_multipart_eof_fix (2.5.0)
daemons (1.1.4)
fastthread (1.0.7)
gem_plugin (0.2.3)
linecache (0.46)
mongrel (1.1.5)
rake (0.9.2)
rbx-require-relative (0.0.5)
ruby-debug-base (0.10.4)
ruby-debug-ide (0.4.16)
ruby-mysql (2.9.4)
mel#ubuntu:/usr/share/eclipse/features$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /home/mel/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
When trying to install Bundler 0.8.1 on Ubuntu machine, it install fine but the executable "bundle" is no where to be seen. Other gems install successfully, including their executables.
using: gem install bundler --version=0.8.1
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
- INSTALLATION DIRECTORY: /home/ahammad/gems
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /home/ahammad/gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/ahammad/gems
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gem1.gilt.com"]
- REMOTE SOURCES:
- http://gems.rubyforge.org/
Path /home/ahammad/gems/bin has been added to PATH, the problem is there is no bundle exe.
Any ideas?
Maybe that specific version of bundler wasn't available for installation, so to choose specific available range of versions which could be available, try:
gem install bundler --version '<= 0.10.6'
Or simple uninstall the previous bundler and install it again. Then check by gem list bundler or bundler _0.9.26_ -v (where 0.9.26 is version of your older gem).
Check also the permissions of your local gem folders.
Learn more: How to upgrade/downgrade Rubygems at rubyforge
That might be. I've used only 1.0. But I had the same problem. A tutorial assumed I could run "bundle". It was fixed only after following the directions here
http://lindsaar.net/2010/3/31/bundle_me_some_sanity
The directions involve installing rvm and creating an app directory with a .rvmrc file among other things.
Then in that directory you can run "bundle".
The binary is ~/.rvm/gems/ruby-1.8.7-p302#railsplugins/bin/bundle
apparently 0.8.1 uses "gem bundle" rather than "bundle"