bundle install error because of therubyracer gem - ruby-on-rails

I'm using rails 4.1.4 and ruby-2.1.1. My Gemfile :
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use mysql as the database for Active Record
gem 'mysql2'
gem 'devise'
gem "paperclip", "~> 4.2"
gem 'aws-sdk'
gem 'bootstrap-sass-rails'
gem 'bootstrap-datepicker-rails'
gem 'jquery-tokeninput-rails'
gem 'carmen-rails'
gem 'will_paginate'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
gem 'byebug'
# gem 'debugger', group: [:development, :test]
# group :production do
# gem "rails_12factor"
# gem "activerecord-postgresql-adapter"
# gem 'pg'
# end
gem 'activemerchant'
but whenever i run the bundle install command Rubymine said,
Gemfile:29: syntax error, unexpected ':', expecting $end
gem 'therubyracer', platforms: :ruby
what should i do? If i commented out the "therubyracer" gem. Then this error shows for sdoc gem.

Try this:
gem 'therubyracer', :platform => :ruby

As I see from your error traceback, you have Ruby 1.8 installed (OS default). Ruby on Rails 4.1 requires at least Ruby 1.9.3. So you can use RVM to install newer Ruby version. Then you'll be able to install all required gems. And using RVM or rbenv is recommended way to manage rubies nowadays.

Related

Cannot run puma server for my application because of bcrypt

My machine is a Windows 8 32 bit machine and I have ruby 2.1.8.
I am facing a problem when I am trying to open my app in puma and rails server. I am even unable to run bundle install. The erorr is:
in `require': 126: The specified module could not be found.
- C:/Ruby21/lib/ruby/gems/2.1.0/gems/bcrypt-ruby-3.1.1.rc1-x86-mingw32/lib/bcrypt_ext.so (LoadError)
and the bundle install error is:
could not find gem 'bcrypt (=3.1.5 rc1) x64-mingw32' in any of the gemfile ruby 2.1.8
same problem happens also for bcrypt version 3.0.0 and 3.1.1 also
My Gemfile is:
source 'http://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.9'
# Use sqlite3 as the database for Active Record
gem 'pg'
gem 'plivo'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
gem 'coffee-script-source', '1.8.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library gem 'jquery-rails'
gem 'rails-jquery-autocomplete', :git 'https://github.com/AyushRuiaHW/rails-jquery-autocomplete.git'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
gem 'tzinfo-data'
gem 'faraday'
gem 'hypdf', '~> 1.0.12'
gem 'currency-in-words'
gem "jquery-ui-rails"
gem 'Instamojo-rb'
gem "kaminari"
gem "rails-erd"
gem 'levenshtein', '~> 0.2.2'
gem "lol_dba"
gem "bullet", :group => "development"
gem "bootstrap-sass"
gem 'rack-mini-profiler'
gem 'newrelic_rpm'
gem 'puma_worker_killer'
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'postmark-rails'
gem 'bcrypt-ruby', '3.1.5.rc1', :require => 'bcrypt'
gem 'puma'
gem "paperclip", "~> 3.0"
gem 'aws-sdk', '~> 1'
gem 'aws-sdk-resources', '~> 2'
gem 'rails_12factor', group: :production
ruby "2.1.8"
delete your old gem 'bcrypt-ruby',and insert
gem 'bcrypt', '~> 3.1', '>= 3.1.11'
and run
bundle install
You need to remove your old gem and update your gemfile with following
gem 'bcrypt-ruby', '~> 3.1.0'
and run bundle install , then restart your server.
You might also want to try deleting your gemfile.lock and re-running bundle install.
OR
you can install gem bcrypt directly from command line as following :
gem install --version='3.1.0' bcrypt-ruby
then run bundle install

Type Error with Active Admin - Ruby on Rails

I am new to Ruby on Rails(4.1.8) and using OS Windows 8, I have added the gem activeadmin in my gemfile and ran commands
rails g active_admin:install --skip-users
rake db:migrate
rails server
but I get the following exception while running http://localhost:3000/admin
TypeError: Object doesn't support this property or method (in
c:/Sites/CleverChalk/app/assets/javascripts/active_admin.js.coffee)
Could someone please advise why this occurs. i read a couple of post on
coffee-script-source and
coffee-rails but they have not worked for me.
My Gemfile is as below :
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg'
gem 'activeadmin', github: 'activeadmin'
gem 'coffee-script-source', '1.8.0'
gem 'coffee-rails', '~> 4.0.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
I could resolve the issue by reinstalling activeadmin with Users that meant adding the devise gem as shown below:
gem 'devise'
to the gemfile and then
bundle install
rails generate devise:install
Thanks.

Ruby on Rails-Cucumber - error: Could not find generator cucumber:install

I'm new to RoR and Cucumber. I've installed RoR and Cucumber and am stepping through the Cucumber Backgrounder (https://github.com/cucumber/cucumber/wiki/Cucumber-Backgrounder)
When I get to this step: run "rails generate cucumber:install" I receive the error: Could not find generator cucumber:install
I reviewed a very similar issue relative to JRuby:
Jruby and Cucumber / Cucumber Rails - Could not find generator cucumber:install
I've tried all of the suggestions there (to the best of my ability) and still get the error message. (setting GEM_HOME and GEM_PATH variables, modifying Gemfile, etc.)
My Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
# added by SC to get cucumber to install
group :test do
gem 'cucumber-rails', :require => false
# database_cleaner is not required, but highly recommended
gem 'database_cleaner'
end
When I run bundle install I notice that cucumber and cucumber-rails are not in the list.
I managed to install both locally, but that didn't resolve the issue.
Any suggestions are appreciated.
you need add in you GemFile in the group of :development, :test
gem 'cucumber-rails', '~> 1.4.2', :require => false
Next use:
rails g cucumber:install
And that's it

rails: debug rails application in eclipse / aptana

I can debug one of my old application. But when I create a new application. I tried to debug using eclipse / aptana. THe debugger didn't launch at all.
Gemfile for my old application
source 'http://rubygems.org'
gem 'rails', '4.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'protected_attributes'
gem 'jquery-rails'
gem 'devise'
gem "less-rails"
gem "libv8" ,'3.16.14.3'
gem "therubyracer"
gem 'twitter-bootstrap-rails', "=2.2.6"
gem 'cancan'
gem 'rolify'
gem 'pusher'
gem 'pg'
gem 'public_activity'
gem 'rspec'
gem 'rspec-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
Gemfile for my new application
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
Something I might be missing?
Thanks for this post
Rails 4.0 project not starting through aptana studio 3
Create a folder script in the root of the app and place rails file from the bin folder to the script folder then it will work. You might need to change the web-server options in the aptana setting also.
I was having the same problem but this fix fixed it

bundle install rails error `parse': Illformed requirement [""] (Gem::Requirement::BadRequirementError)

ran bundle install
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/judyngai/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb:90:in `parse': Illformed requirement [""] (Gem::Requirement::BadRequirementError)
what is the problem with my bundler?
is working in a blank app but just not at the app that I am working on.
thank you
here is my gemfile as requested
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
#High Voltage
gem "high_voltage", "~> 1.2.4"
#Database
gem "pg", "~> 0.16.0"
#to make attribute accessible work
gem "protected_attributes", "~> 1.0.3"
#Authentication , upgrading devise?
gem "devise", "~> 3.0.3"
#Active Admin
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
#Simple Form
gem 'simple_form'
#js runting for bootstrap to work
gem "therubyracer"
#Web Server
gem "thin"
#Student Picture Uploaders
gem "rmagick"
gem "carrierwave"
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
I don't see any syntax errors in my gemfile. I remember seeing the same error before and removed an extra comma from my gemfile.

Resources