gem installation ok but not with bundle - ruby-on-rails

I am trying to install the pusher-client gem.
I've put this in my Gemfile:
gem "pusher-client",:git=>"git://github.com/logankoester/pusher-client.git"
bundle install is ok
But when I start the app:
/Users/thomas/.rvm/gems/ruby-1.9.2-p318/gems/bundler-1.2.0/lib/bundler/runtime.rb:76:in `require': no such file to load -- pusher/client (LoadError)
from /Users/thomas/.rvm/gems/ruby-1.9.2-p318/gems/bundler-1.2.0/lib/bundler/runtime.rb:76:in `rescue in block in require'
from /Users/thomas/.rvm/gems/ruby-1.9.2-p318/gems/bundler-1.2.0/lib/bundler/runtime.rb:62:in `block in require'
from /Users/thomas/.rvm/gems/ruby-1.9.2-p318/gems/bundler-1.2.0/lib/bundler/runtime.rb:55:in `each'
from /Users/thomas/.rvm/gems/ruby-1.9.2-p318/gems/bundler-1.2.0/lib/bundler/runtime.rb:55:in `require'
from /Users/thomas/.rvm/gems/ruby-1.9.2-p318/gems/bundler-1.2.0/lib/bundler.rb:128:in `require'
from /Users/thomas/Documents/TweetTv/server/tvtweet/config/application.rb:12:in `<top (required)>'
from /Users/thomas/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.0/lib/rails/commands.rb:38:in `require'
from /Users/thomas/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.0/lib/rails/commands.rb:38:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
It seems to be linked to the - in the gem name, but other gem install correctly.
Any help or suggestion greatly appreciate...

Your git path is wrong. If you go to the repository on GitHub you'll see the code has moved to here.
You should do this in your Gemfile instead:
gem 'pusher-client', :git => "git://github.com/pusher/pusher-ruby-client.git"

Related

I can´t run server in Ubuntu 14.02 with ruby 2.2.2 and Rails 4

I´ve a problem when run Rails server. I just installed gem server, but still not working. I am new to the world of programming . I am grateful to anyone who can help me.
Copy an image of the error: http://i.stack.imgur.com/wS7oS.png.
/home/hugo/.rvm/gems/ruby-2.2.2/gems/activesupport-4.0.5/lib/active_support/values/time_zone.rb:283: warning: circular argument reference - now
/home/hugo/.rvm/gems/ruby-2.2.2/gems/execjs-2.5.2/lib/execjs/runtimes.rb:48:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/execjs-2.5.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/execjs-2.5.2/lib/execjs.rb:4:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/uglifier-2.7.1/lib/uglifier.rb:3:in `require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/uglifier-2.7.1/lib/uglifier.rb:3:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:76:in `require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:72:in `each'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:61:in `each'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler/runtime.rb:61:in `require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.2/lib/bundler.rb:133:in `require'
from /home/hugo/pin_board/config/application.rb:7:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/railties-4.0.5/lib/rails/commands.rb:74:in `require'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/railties-4.0.5/lib/rails/commands.rb:74:in `block in <top (required)>'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/railties-4.0.5/lib/rails/commands.rb:71:in `tap'
from /home/hugo/.rvm/gems/ruby-2.2.2/gems/railties-4.0.5/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
This seems like a similar question to ExecJS and could not find a JavaScript runtime. The resolution here was to ensure NodeJS was installed on the machine:
sudo apt-get install nodejs
uncomment
gem 'therubyracer', platforms: :ruby
in your Gemfile.
Please do
bundle install
after adding 'therubyracer' gem

Rails - Amazon minitest/unit (LoadError)

I have hosted one Ruby on Rails application on Amazon EC2. I am using Java SSH Client to connect the instance. When I go to my working directory on Amazon and trying to put rails c then it showing error require': cannot load such file -- minitest/unit (LoadError). I don't know why I am not able to access rails console.
/usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- minitest/unit (LoadError)
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/test/unit/assertions.rb:1:in `<top (required)>'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/test/unit/testcase.rb:1:in `<top (required)>'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/test_case.rb:1:in `<top (required)>'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/console/app.rb:2:in `<top (required)>'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:304:in `initialize_console'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:152:in `load_console'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:27:in `start'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I tried to solve this error by installing gem install minitest-rails but it throwing error
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/share/ruby/1.9/gems/1.9.1 directory.
I tried to add two gems gem 'turn' , '< 0.8.3' and gem 'minitest-rails in my gemfile also and then push to AWS but not getting anything.
How to get rid of this error. I want to access my rails console. Please help. Thanks in advance.
To get past this error I had to do both a "gem install minitest" and add "gem 'minitest'" to the project Gemfile. I came by this solution by reading the comments on this open issue for Rails on GitHub; you might find further solutions there until this is resolved.
Try this
group :test do
gem 'turn', '< 0.8.3',
gem 'minitest', '~> 5.0.5'
end
Correct me if I am wrong but I guess you are trying to install Cucumber. If not please specify your rails version and ruby version.

'rails console' command throwing error in Rails 3.2.9

I am using Rails 3.2.9 with ruby 1.9.3 (made default using RVM). From the root directory of my test_app when I executed the command 'rails console' / 'rails c', the following error is showing.
rails console
/home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
from /home/local/rajesh.co/Rajesh/blog/config/application.rb:7:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands.rb:39:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can anyone help me to resolve this?
Yes, I got the answer for my question.
Just Open the file 'Gemfile' inside the root directory of your application folder, and then paste the below lines there.
gem 'execjs'
gem 'libv8'
gem 'therubyracer'
After pasting it, just save the file and execute 'bundle update' on the command prompt.
On finishing bundle update successfully, you try running 'rails c' or 'rails console' for taking the rails console. It works!!
Thank you.
Install the folowing both:
gem 'execjs'
gem 'therubyracer'
Try installing
gem 'therubyracer'
Source

Can't run command 'rails server'!

I have created a test application, installed bundle and all the gems.
When i cd into the app and enter the command 'rails s' or 'rails server', this is what I get back:
/Library/Ruby/Gems/1.8/gems/bundler-1.1.1/lib/bundler/runtime.rb:213: warning: Insecure world writable dir /Library/Ruby/Gems/1.8 in PATH, mode 040777
gem install minitest
/Library/Ruby/Gems/1.8/gems/turn-0.9.6/lib/turn/minitest.rb:9:in `require': no such file to load -- minitest/unit (LoadError)
from /Library/Ruby/Gems/1.8/gems/turn-0.9.6/lib/turn/minitest.rb:9
from /Library/Ruby/Gems/1.8/gems/turn-0.9.6/lib/turn.rb:13:in `require'
from /Library/Ruby/Gems/1.8/gems/turn-0.9.6/lib/turn.rb:13
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.1/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.1/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.1/lib/bundler/runtime.rb:66:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.1/lib/bundler/runtime.rb:66:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.1/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.1/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.1/lib/bundler.rb:119:in `require'
from /Applications/MAMP/htdocs/railsTestApp1/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.2/lib/rails/commands.rb:53:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.2/lib/rails/commands.rb:53
from /Library/Ruby/Gems/1.8/gems/railties-3.2.2/lib/rails/commands.rb:50:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.2/lib/rails/commands.rb:50
from script/rails:6:in `require'
from script/rails:6
I have tried to figure out what is missing. Desperately, I tried installing the gem minitest into /Ruby/Gems/ as well as in /Ruby/Gems/1.8/gems/, but obviously I have no idea what I'm doing here. So please, I what am I doing wrong??

problem on setting up ruby on rails

I just started learning ruby on rails with "Lynda Ruby on Rails 3 Essential Training".
I finished the installation, and created rails application by writing- "rails new app".
After that when I wrote - "rails server", that's what I saw:
C:\Users\Oded\sites\simple_cms>rails server
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.r
b:2:in `require': 193: %1 is not a valid Win32 application. - C:/Ruby192/lib/r
uby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError
)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2.rb:7:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:64:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:64:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:62:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:62:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:51:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:51:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:11
2:in `require'
from C:/Users/Oded/sites/simple_cms/config/application.rb:7:in `<top (re
quired)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can you please help me find the solution?
Happy holidays,
Oded
Looks like you're missing some gems! try running bundle install... then all should work.
EDIT: make sure that your Gemfile contains the line
gem 'mysql'
before running bundle install. Bundler will get you set up for mysql, dependencies and all.
You have to go to this website and follow the directions ...
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
or in short download the connector mentioned in the article from mysql or a mirror site
Run this command:
gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32
Make sure you have the correct path to the mysql connector folder that has no spaces!!
After that is complete make sure you copy the libmysql.dll file from the connector library you unzipped and downloaded and placed that in the Ruby\bin file.
After that delete the connector libary and start it up by typing 'rails server' making sure your gem file has the line gem 'mysql' or gem 'mysql2' I'm not sure which one so try both. It sucks and they really need to fix this for windows.

Resources