Error starting rails server using Rails Composer - macos

I created a new rails application using Rails Composer and it was able to see all the project files.
However, if I start rails server, I'm getting following error -
/Users/aniruddhabarapatre1/RubyRails/rails-bootstrap/config/application.rb:7:in `<top (required)>': uninitialized constant Bundler (NameError)
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247#rails-bootstrap/gems/railties-4.0.3/lib/rails/commands.rb:74:in `block in <top (required)>'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247#rails-bootstrap/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
from /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247#rails-bootstrap/gems/railties-4.0.3/lib/rails/commands.rb:71:in `<top (required)>'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from bin/rails:4:in `<main>'
I am unsure of what I'm missing here. I tried searching for solution by looking for the error, but with no success.

Related

`##{' is not allowed as a class variable name (SyntaxError) while using s3 gem + rails 4.1.5

I know this type of question is already asked.
I use s3 gem to upload my files in s3 bucket. But after s3 gem installation, when I start rails server it shows this error:
/var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in `class_eval': /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223: `##{' is not allowed as a class variable name (SyntaxError)
/var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223: syntax error, unexpected $end
unless defined? ##{:instance_writer=>true}
^
from /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in `block in cattr_reader'
from /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:222:in `each'
from /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:222:in `cattr_reader'
from /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:258:in `cattr_accessor'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/cache.rb:155:in `<class:Store>'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/cache.rb:154:in `<module:Cache>'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/cache.rb:14:in `<module:ActiveSupport>'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/cache.rb:12:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /var/lib/gems/1.9.1/gems/jbuilder-2.2.5/lib/jbuilder/jbuilder_template.rb:3:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /var/lib/gems/1.9.1/gems/jbuilder-2.2.5/lib/jbuilder/railtie.rb:2:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /var/lib/gems/1.9.1/gems/jbuilder-2.2.5/lib/jbuilder.rb:317:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /home/rick/rick/Projects/practice/sharebox/config/application.rb:7:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in `require'
from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in `server'
from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Does anyone know, how to solve this error? Should I try another gem?
Yeah i just ran into this issue and resolved. It is because AWS updated their gem to 2.0. If you update the gem to 2.0 different configuration is required according to this article they posted.
If you want to using the version you had before, just change the Gemfile like below:
Gemfile
gem 'aws-sdk', '< 2.0'
We had the same issue this morning. We already had this aws-sdk gem installed but it was updated to version 2 yesterday. It seems that version 2 doesn't fix this anymore so I advice to use last version 1 : 1.61.0

Fail to run rails server

I cannot run my rails server. I used rails on windows 64 bit. When i run
rails server
I get the following results:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15/lib/mysql2.rb
:8:in `require': 193: %1 is not a valid Win32 application. - C:/RailsInstaller
/Ruby1.9.3/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/mysql2-0.3.15/mysql2
/mysql2.so (LoadError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15/
lib/mysql2.rb:8:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/
lib/bundler/runtime.rb:72:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/
lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/
lib/bundler/runtime.rb:70:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/
lib/bundler/runtime.rb:70:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/
lib/bundler/runtime.rb:59:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/
lib/bundler/runtime.rb:59:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/
lib/bundler.rb:132:in `require'
from C:/Users/azlan187/Sites/simple_cms/config/application.rb:7:in `<top
(required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2
/lib/rails/commands.rb:74:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2
/lib/rails/commands.rb:74:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2
/lib/rails/commands.rb:71:in `tap'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2
/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I absolutely don't know how to fix this. Any help would be really appreciated!
ps: please tell me if i need to provide more info. Thanks.
Are you using a 64-bit system? The first line of your error output complains about mysql.so not being a valid Win32 application. I would start investigating on that, and if it does not yield anything, try googling for "mysql gem errors". I personally had a lot of problems getting the mysql gem to work on windows, andfrom my past experience, usually it is a matter of sourcing the correct libmysql file.

ActiveRecord::Base.establish_connection Fails with Name Error: uninitialized constant Arel::Visitors::MySQL

I was using ActiveRecod with my sinatra app and mysql db which was working fine till yesterday. Today i am having strange errors with it. On using mysql2 as adapter the following error is encountered.
irb(main):008:0> ActiveRecord::Base.establish_connection(:adapter=>"mysql2",:host=>"localhost",:username=>"tushar",:password=>"samael321",:database=>"Chat_test")
NameError: uninitialized constant Arel::Visitors::MySQL
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:466:in `rescue in load_missing_constant'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:462:in `load_missing_constant'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:106:in `const_missing_with_dependencies'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:128:in `<class:AbstractMysqlAdapter>'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:6:in `<module:ConnectionAdapters>'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:5:in `<module:ActiveRecord>'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:4:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:182:in `block in require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:547:in `new_constants_in'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:1:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:182:in `block in require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:547:in `new_constants_in'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:182:in `require'
from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_specification.rb:69:in `establish_connection'
from (irb):8
from /usr/bin/irb:12:in `<main>'
I am unable to figure out any thing about the issue on net.
My ruby version is as below:
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
My gem version is as below
1.8.11
SOLVED
Suddenly i have stopped to encounter any error for the same. I have removed the ruby 1.8 that was earlier present, after which i am not facing an error. Still any explanation to this is required as i dont know what solved the problem.

Where is sqlite3_native.rb in Windows with Ruby 2.0?

Using Ruby 2.0 x64 on Windows. Installed sqlite3 gem by downloading the sqlite3 autoconf sources and compiling. Then I did a gem install sqlite3 --platform=ruby .... However, now when I run rails server, I get the following error. Where is this sqlite3_native.rb? I can't find it anywhere.
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from C:/Users/me/my_project/config/application.rb:7:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `block in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `tap'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Here is a tutorial for installing SQLite3 with Ruby 2.0 on Windows.
It is rather a complicated process. Follow the tutorial and see if it works after that.

problem with running ruby application

I am using RubyMine on windows so I can run a given ruby on rails application. When I click run I get the following error:
C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) "F:/Aurora Zoo Project/zooniverse-Juggernaut-a46b0ba558f0cbeb8e9b581513691566d7f19c2f/script/rails" server -b 127.0.0.1 -p 3000 -e development
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/mysql.rb:7:in `require': 126: The specified module could not be found. - C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/mysql.rb:7:in `rescue in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/mysql.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:120:in `require'
from F:/Aurora Zoo Project/zooniverse-Juggernaut-a46b0ba558f0cbeb8e9b581513691566d7f19c2f/config/application.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
from F:/Aurora Zoo Project/zooniverse-Juggernaut-a46b0ba558f0cbeb8e9b581513691566d7f19c2f/script/rails:9:in `require'
from F:/Aurora Zoo Project/zooniverse-Juggernaut-a46b0ba558f0cbeb8e9b581513691566d7f19c2f/script/rails:9:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
I am not really familiar with ruby, but it says something about "mysql" which I have installed and added to the PATH variable.
Any help? Thx
The mysql gem that you installed expect an specific version of MySQL libmysql.dll be available in your system (when you gem install mysql it display the proper legend in the console).
mysql_api.so is failing to load and thus, generating the error you're seeing.
I've blogged about an alternate approach to install and compile the MySQL component independently of the version of MySQL you have installed.
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
Hope that helps.
This is probably version problem. I do had a same issue when i used old mysql version with new mysql gem.
Kindly find the correctly gem required for you mysql server.

Resources